@e-llm-studio/citation 0.0.228 → 0.0.229
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 +112 -0
- package/dist/cjs/features/PromptemonBlockViewer/PromptemonBlockViewer.js +2 -0
- package/dist/cjs/features/PromptemonBlockViewer/PromptemonBlockViewer.js.map +1 -0
- package/dist/cjs/features/PromptemonViewer/PromptemonViewer.js +2 -0
- package/dist/cjs/features/PromptemonViewer/PromptemonViewer.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/features/PromptemonBlockViewer/PromptemonBlockViewer.js +2 -0
- package/dist/features/PromptemonBlockViewer/PromptemonBlockViewer.js.map +1 -0
- package/dist/features/PromptemonViewer/PromptemonViewer.js +2 -0
- package/dist/features/PromptemonViewer/PromptemonViewer.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/types/src/PromptemonBlockViewerTest.d.ts +3 -0
- package/dist/types/src/PromptemonBlockViewerTest.d.ts.map +1 -0
- package/dist/types/src/PromptemonViewerTest.d.ts +3 -0
- package/dist/types/src/PromptemonViewerTest.d.ts.map +1 -0
- package/dist/types/src/features/PromptemonBlockViewer/PromptemonBlockViewer.d.ts +11 -0
- package/dist/types/src/features/PromptemonBlockViewer/PromptemonBlockViewer.d.ts.map +1 -0
- package/dist/types/src/features/PromptemonBlockViewer/index.d.ts +3 -0
- package/dist/types/src/features/PromptemonBlockViewer/index.d.ts.map +1 -0
- package/dist/types/src/features/PromptemonViewer/PromptemonViewer.d.ts +43 -0
- package/dist/types/src/features/PromptemonViewer/PromptemonViewer.d.ts.map +1 -0
- package/dist/types/src/features/PromptemonViewer/index.d.ts +3 -0
- package/dist/types/src/features/PromptemonViewer/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
- [SplitterCitationsComponent](#splittercitationscomponent) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/SplitterCitations/README.md)
|
|
38
38
|
- [RuleBookCitationWrapper](#RuleBookCitationWrapper) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/RuleBookCitations/README.md)
|
|
39
39
|
-[ManageReminders](#ManageReminders) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ManageRemainders/README.md)
|
|
40
|
+
- [PromptemonBlockViewer](#promptemonblockviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PromptemonBlockViewer/PromptemonBlockViewerReadme.md)
|
|
41
|
+
- [PromptemonViewer](#promptemonviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PromptemonViewer/PromptemonViewerReadme.md)
|
|
40
42
|
4. [Common Use Cases](#common-use-cases)
|
|
41
43
|
5. [Development & Contribution](#development--contribution)
|
|
42
44
|
6. [License](#license)
|
|
@@ -3110,6 +3112,116 @@ Renders: `[3] ⠋` (spinner) until `isStreaming` becomes `false`.
|
|
|
3110
3112
|
|
|
3111
3113
|
---
|
|
3112
3114
|
|
|
3115
|
+
|
|
3116
|
+
---
|
|
3117
|
+
|
|
3118
|
+
## PromptemonBlockViewer
|
|
3119
|
+
|
|
3120
|
+
### Overview
|
|
3121
|
+
|
|
3122
|
+
A Monaco-based code editor component for viewing and highlighting prompt blocks. Supports XML tag highlighting, variable highlighting, dark/light theme toggling, and a fullscreen dialog with a description panel.
|
|
3123
|
+
|
|
3124
|
+
### Features
|
|
3125
|
+
|
|
3126
|
+
- **Monaco editor with custom syntax highlighting** — XML tags and `{{variables}}` highlighted with custom token colors
|
|
3127
|
+
- **XML tag highlighting** — Scrolls to and highlights a specific XML tag block
|
|
3128
|
+
- **Variable highlighting** — Highlights all occurrences of a `{{variable}}`
|
|
3129
|
+
- **Dark/light theme toggle** — Switch between themes with a toggle
|
|
3130
|
+
- **Fullscreen dialog** — Description panel on left, full editor on right
|
|
3131
|
+
|
|
3132
|
+
### Usage
|
|
3133
|
+
|
|
3134
|
+
```tsx
|
|
3135
|
+
import PromptemonBlockViewer from '@e-llm-studio/citation/PromptemonBlockViewer'
|
|
3136
|
+
|
|
3137
|
+
<PromptemonBlockViewer
|
|
3138
|
+
title="role"
|
|
3139
|
+
description="This APB establishes the core identity of the AI Assistant."
|
|
3140
|
+
content={`<Role>\nYou are a {{ORGANIZATION_NAME}} AI Assistant.\n</Role>`}
|
|
3141
|
+
height={300}
|
|
3142
|
+
selectedTag="Role"
|
|
3143
|
+
highlightVariable="{{ORGANIZATION_NAME}}"
|
|
3144
|
+
/>
|
|
3145
|
+
```
|
|
3146
|
+
|
|
3147
|
+
### Props
|
|
3148
|
+
|
|
3149
|
+
| Prop Name | Type | Required | Default | Description |
|
|
3150
|
+
|-----------|------|----------|---------|-------------|
|
|
3151
|
+
| `title` | `string` | ✅ | — | Title shown in header and fullscreen dialog |
|
|
3152
|
+
| `content` | `string` | ✅ | — | Prompt content to display in the editor |
|
|
3153
|
+
| `description` | `string` | ❌ | — | Description shown in fullscreen left panel |
|
|
3154
|
+
| `height` | `number` | ❌ | `250` | Height of mini editor in pixels |
|
|
3155
|
+
| `selectedTag` | `string` | ❌ | — | XML tag name to highlight and scroll to |
|
|
3156
|
+
| `highlightVariable` | `string` | ❌ | — | Variable string to highlight |
|
|
3157
|
+
|
|
3158
|
+
---
|
|
3159
|
+
|
|
3160
|
+
## PromptemonViewer
|
|
3161
|
+
|
|
3162
|
+
### Overview
|
|
3163
|
+
|
|
3164
|
+
A full-featured interface for viewing, editing, and managing Functional Prompt Blocks (FPBs). Combines a detailed left panel showing FPB metadata with a Monaco-based right panel for viewing prompt content and extracted segments. Consumer-controlled — all API calls and state management are handled by the consumer.
|
|
3165
|
+
|
|
3166
|
+
### Features
|
|
3167
|
+
|
|
3168
|
+
- **Full FPB metadata panel** — Title, description, categories, APBs, applicability, specifications
|
|
3169
|
+
- **Edit mode** — Inline editing with confirm/cancel flow
|
|
3170
|
+
- **Segment chips** — Shows extracted `{{variable}}` segments per APB after extraction
|
|
3171
|
+
- **Monaco editor** — Switches to segmentized content after extraction
|
|
3172
|
+
- **Extract Segments flow** — Loading overlay while extracting
|
|
3173
|
+
- **Save FPB** — Enabled after extraction, locks editing after save
|
|
3174
|
+
- **Category/Sub-category selection** — Consumer provides categories and handles creation
|
|
3175
|
+
|
|
3176
|
+
### Usage
|
|
3177
|
+
|
|
3178
|
+
```tsx
|
|
3179
|
+
import PromptemonViewer from '@e-llm-studio/citation/PromptemonViewer'
|
|
3180
|
+
|
|
3181
|
+
<PromptemonViewer
|
|
3182
|
+
block={myFPBBlock}
|
|
3183
|
+
onBlockUpdate={setBlock}
|
|
3184
|
+
isExtracting={isExtracting}
|
|
3185
|
+
isExtracted={isExtracted}
|
|
3186
|
+
onExtractSegments={handleExtractSegments}
|
|
3187
|
+
isSaving={isSaving}
|
|
3188
|
+
isSaved={isSaved}
|
|
3189
|
+
onSave={handleSave}
|
|
3190
|
+
onBack={() => navigate(-1)}
|
|
3191
|
+
categories={categories}
|
|
3192
|
+
subCategories={subCategories}
|
|
3193
|
+
selectedCategoryId={selectedCategoryId}
|
|
3194
|
+
selectedSubCategoryId={selectedSubCategoryId}
|
|
3195
|
+
onCategoryChange={(id) => setSelectedCategoryId(id)}
|
|
3196
|
+
onSubCategoryChange={(id) => setSelectedSubCategoryId(id)}
|
|
3197
|
+
/>
|
|
3198
|
+
```
|
|
3199
|
+
|
|
3200
|
+
### Props
|
|
3201
|
+
|
|
3202
|
+
| Prop Name | Type | Required | Description |
|
|
3203
|
+
|-----------|------|----------|-------------|
|
|
3204
|
+
| `block` | `any` | ✅ | FPB block object |
|
|
3205
|
+
| `onBlockUpdate` | `(updatedBlock: any) => void` | ✅ | Called when user confirms edits |
|
|
3206
|
+
| `isExtracting` | `boolean` | ✅ | Shows loading overlay while true |
|
|
3207
|
+
| `isExtracted` | `boolean` | ✅ | Shows segment chips and enables Save when true |
|
|
3208
|
+
| `onExtractSegments` | `() => void` | ✅ | Called when Extract Segments is clicked |
|
|
3209
|
+
| `isSaving` | `boolean` | ✅ | Shows "Saving..." while true |
|
|
3210
|
+
| `isSaved` | `boolean` | ✅ | Shows "Saved ✓" and locks editing when true |
|
|
3211
|
+
| `onSave` | `() => void` | ✅ | Called when Save FPB is clicked |
|
|
3212
|
+
| `onBack` | `() => void` | ✅ | Called when back/close is clicked |
|
|
3213
|
+
| `title` | `string` | ❌ | Title shown in top bar (default: "FPB Promptemon") |
|
|
3214
|
+
| `categories` | `SPBCategory[]` | ✅ | List of categories |
|
|
3215
|
+
| `subCategories` | `SPBSubCategory[]` | ✅ | List of sub-categories |
|
|
3216
|
+
| `selectedCategoryId` | `string` | ✅ | Currently selected category ID |
|
|
3217
|
+
| `selectedSubCategoryId` | `string` | ✅ | Currently selected sub-category ID |
|
|
3218
|
+
| `onCategoryChange` | `(id: string) => void` | ✅ | Called when category is selected |
|
|
3219
|
+
| `onSubCategoryChange` | `(id: string) => void` | ✅ | Called when sub-category is selected |
|
|
3220
|
+
| `onAddCategory` | `(data: { name: string; description: string }) => Promise<void>` | ❌ | Called when new category is created |
|
|
3221
|
+
| `onAddSubCategory` | `(data: { name: string; description: string; categoryId: string }) => Promise<void>` | ❌ | Called when new sub-category is created |
|
|
3222
|
+
| `showEditMode` | `boolean` | ❌ | `true` | Show/hide the edit pencil icon and edit mode |
|
|
3223
|
+
| `showExtractSegments` | `boolean` | ❌ | `true` | Show/hide the Extract Segments button and Show Segments toggle |
|
|
3224
|
+
|
|
3113
3225
|
## EmailCitation
|
|
3114
3226
|
|
|
3115
3227
|
A composable React UI component for rendering email-style citations with rich formatting, attachments, and highlight/quote handling. Part of the `@e-llm-studio/citation` package, this component is designed to display email content (subject, sender, recipients, body, attachments, timestamps) in an expandable, accessible, and customizable way.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),o=require("react"),t=require("@mui/material"),i=require("@mui/icons-material/Close"),n=require("@mui/icons-material/Fullscreen"),s=require("@monaco-editor/react"),a=require("monaco-editor"),l=require("@mui/icons-material/DarkMode"),d=require("@mui/icons-material/LightMode");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var t=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,t.get?t:{enumerable:!0,get:function(){return e[o]}})}}),r.default=e,Object.freeze(r)}var c=g(i),f=g(n),h=g(s),x=u(a),p=g(l),m=g(d),b={base:"vs-dark",inherit:!0,rules:[{token:"tag",foreground:"714be3",fontStyle:"bold"},{token:"attribute.name",foreground:"87CEFA"},{token:"attribute.value",foreground:"98FB98"},{token:"variable",foreground:"00FFFF"},{token:"delimiter",foreground:"888888"},{token:"white",foreground:"AAAAAA"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#030202","editorLineNumber.foreground":"#858585","editorCursor.foreground":"#FFFFFF","editorIndentGuide.background":"#404040","editorIndentGuide.activeBackground":"#707070"}},_={base:"vs",inherit:!0,rules:[{token:"tag",foreground:"5928ED",fontStyle:"bold"},{token:"attribute.name",foreground:"AF00DB"},{token:"attribute.value",foreground:"008000"},{token:"variable",foreground:"B000B0"},{token:"delimiter",foreground:"808080"},{token:"white",foreground:"000000"}],colors:{"editor.foreground":"#000000","editor.background":"#FFFFFF","editorLineNumber.foreground":"#999999","editorCursor.foreground":"#000000","editorIndentGuide.background":"#CCCCCC","editorIndentGuide.activeBackground":"#999999"}},v=function(o){var i=o.isDarkMode,n=o.onChange;return r.jsx(t.Box,e.__assign({onClick:function(){return n(!i)},sx:{width:52,height:24,borderRadius:"12px",bgcolor:i?"#5928ed":"#f0f0f0",border:"1px solid",borderColor:i?"#5928ed":"#d1d5db",display:"flex",alignItems:"center",px:.4,cursor:"pointer",transition:"all 0.2s",justifyContent:i?"flex-end":"flex-start"}},{children:r.jsx(t.Box,e.__assign({sx:{width:18,height:18,borderRadius:"50%",bgcolor:i?"#1e1e2e":"#f59e0b",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"}},{children:i?r.jsx(p.default,{sx:{fontSize:11,color:"#fff"}}):r.jsx(m.default,{sx:{fontSize:11,color:"#fff"}})}))}))},j=function(i){var n=i.content,s=i.selectedTag,a=i.highlightVariable,l=i.isDarkMode,d=i.height,g=void 0===d?250:d,u=i.fontSize,c=void 0===u?12:u,f=o.useRef(),p=o.useRef();return o.useEffect(function(){if(s&&f.current&&p.current){var e=f.current,r=e.getModel();if(r){for(var o=r.getValue().split("\n"),t=-1,i=0;i<o.length;i++){var n=o[i].match(/<([^\s>\/]+(?:\s[^\s>\/]+)*)/);if(n&&n[1].trim().toLowerCase()===s.toLowerCase()){t=i+1;break}}if(t>0){var a=t,l="</".concat(s.toLowerCase(),">");for(i=t;i<o.length;i++)if(o[i].toLowerCase().includes(l)){a=i+1;break}e.setSelection(new p.current.Selection(t,1,t,1)),e.trigger(null,"editor.unfold",{}),e.revealLineInCenterIfOutsideViewport(t);var d=e.deltaDecorations([],[{range:new p.current.Range(t,1,a,o[a-1].length+1),options:{isWholeLine:!0,className:"promptemon-highlight",inlineClassName:"promptemon-highlight"}}]);setTimeout(function(){return e.deltaDecorations(d,[])},2e3)}}}},[s]),o.useEffect(function(){if(a&&f.current&&p.current){var e=f.current,r=e.getModel();if(r){for(var o=r.getValue().split("\n"),t=[],i=0;i<o.length;i++)for(var n=o[i].indexOf(a);-1!==n;)t.push(new x.Range(i+1,n+1,i+1,n+a.length+1)),n=o[i].indexOf(a,n+1);if(0!==t.length){e.revealLineInCenterIfOutsideViewport(t[0].startLineNumber);var s=e.deltaDecorations([],t.map(function(e){return{range:e,options:{inlineClassName:"promptemon-variable-highlight"}}}));setTimeout(function(){return e.deltaDecorations(s,[])},2e3)}}}},[a]),o.useEffect(function(){p.current&&p.current.editor.setTheme(l?"promptemonDark":"promptemonLight")},[l]),r.jsxs(r.Fragment,{children:[r.jsx("style",{children:"\n .promptemon-highlight { background-color: rgba(89, 40, 237, 0.15); }\n .promptemon-variable-highlight { background-color: rgba(0, 255, 255, 0.2); border-radius: 2px; }\n "}),r.jsxs(t.Box,e.__assign({sx:{width:"100%",height:g,display:"flex",flexDirection:"column"}},{children:[r.jsx(t.Box,{sx:{width:"100%",height:20,bgcolor:l?"#030202":"#fff",borderTopLeftRadius:8,borderTopRightRadius:8}}),r.jsx(t.Box,e.__assign({sx:{flex:1,minHeight:0,overflow:"hidden"}},{children:r.jsx(h.default,{onMount:function(e,r){f.current=e,p.current=r,r.editor.defineTheme("promptemonDark",b),r.editor.defineTheme("promptemonLight",_),r.editor.setTheme(l?"promptemonDark":"promptemonLight"),r.languages.register({id:"promptemonLang"}),r.languages.setMonarchTokensProvider("promptemonLang",{tokenizer:{root:[[/(<)([a-zA-Z0-9\-]+)(\s*)/,["delimiter","tag","white"],"@tagBody"],[/(<\/)([a-zA-Z0-9\-]+)(\s*)(>)/,["delimiter","tag","white","delimiter"]],[/{{[^}]+}}/,"variable"]],tagBody:[[/[a-zA-Z0-9\:\-]+(?=\=)/,"attribute.name"],[/=/,"delimiter"],[/(".*?"|'.*?')/,"attribute.value"],[/\s+/,"white"],[/(\/?>)/,{token:"delimiter",next:"@pop"}]]}}),r.languages.registerFoldingRangeProvider("promptemonLang",{provideFoldingRanges:function(e){var r=e.getLinesContent(),o=[],t=[];return r.forEach(function(e,r){var i=r+1,n=e.match(/<([a-zA-Z0-9\-]+)(\s[^>]*)?>/),s=e.match(/<\/([a-zA-Z0-9\-]+)>/);if(n&&!e.includes("/>")&&t.push({tag:n[1],start:i}),s)for(var a=s[1],l=t.length-1;l>=0;l--)if(t[l].tag===a){o.push({start:t[l].start,end:i}),t.splice(l,1);break}}),o}})},beforeMount:function(e){e.editor.defineTheme("promptemonDark",b),e.editor.defineTheme("promptemonLight",_),e.editor.setTheme(l?"promptemonDark":"promptemonLight")},theme:l?"promptemonDark":"promptemonLight",value:n,language:"promptemonLang",onChange:function(){},options:{fontSize:c,minimap:{enabled:!1},wordWrap:"on",lineNumbers:"on",readOnly:!0,domReadOnly:!0,scrollBeyondLastLine:!1,padding:{top:4,bottom:12},folding:!0,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:8}}})})),r.jsx(t.Box,{sx:{width:"100%",height:20,bgcolor:l?"#030202":"#fff",borderBottomLeftRadius:8,borderBottomRightRadius:8}})]}))]})};exports.default=function(i){var n=i.title,s=i.description,a=i.content,l=i.height,d=void 0===l?250:l,g=i.selectedTag,u=i.highlightVariable,h=o.useState(!0),x=h[0],p=h[1],m=o.useState(!1),b=m[0],_=m[1];return r.jsxs(r.Fragment,{children:[r.jsxs(t.Box,e.__assign({sx:{border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:[r.jsxs(t.Box,e.__assign({sx:{px:1.5,py:.75,bgcolor:"#f9fafb",borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[r.jsx(t.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#374151",fontWeight:600}},{children:n})),r.jsxs(t.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:.75}},{children:[r.jsx(v,{isDarkMode:x,onChange:p}),r.jsx(t.Tooltip,e.__assign({title:"Fullscreen",placement:"top"},{children:r.jsx(t.Box,e.__assign({onClick:function(){return _(!0)},sx:{cursor:"pointer",display:"flex",alignItems:"center",p:.3,borderRadius:"4px","&:hover":{bgcolor:"#e5e7eb"}}},{children:r.jsx(f.default,{sx:{fontSize:"0.9rem",color:"#6b7280"}})}))}))]}))]})),r.jsx(t.Box,e.__assign({sx:{height:d,bgcolor:x?"#030202":"#fff"}},{children:r.jsx(j,{content:a,selectedTag:g,highlightVariable:u,isDarkMode:x,height:d,fontSize:12})}))]})),r.jsxs(t.Dialog,e.__assign({open:b,onClose:function(){return _(!1)},maxWidth:!1,PaperProps:{sx:{width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"}}},{children:[r.jsxs(t.Box,e.__assign({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[r.jsx(t.Typography,e.__assign({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:n})),r.jsx(t.IconButton,e.__assign({size:"small",onClick:function(){return _(!1)}},{children:r.jsx(c.default,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),r.jsxs(t.Box,e.__assign({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[s&&r.jsxs(t.Box,e.__assign({sx:{width:"35%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[r.jsxs(t.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[r.jsx(t.Chip,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}}),r.jsx(t.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:n}))]})),r.jsx(t.Box,e.__assign({sx:{flex:1,p:2,overflowY:"auto"}},{children:r.jsxs(t.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[r.jsx(t.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),r.jsx(t.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:s}))]}))}))]})),r.jsxs(t.Box,e.__assign({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[r.jsxs(t.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[r.jsx(t.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),r.jsx(v,{isDarkMode:x,onChange:p})]})),r.jsx(t.Box,e.__assign({sx:{flex:1,minHeight:0,p:1.5}},{children:r.jsx(j,{content:a,selectedTag:g,highlightVariable:u,isDarkMode:x,height:"100%",fontSize:13})}))]}))]}))]}))]})};
|
|
2
|
+
//# sourceMappingURL=PromptemonBlockViewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptemonBlockViewer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),o=require("@mui/material"),t=require("@mui/icons-material/ExpandMore"),r=require("@mui/icons-material/EditOutlined"),s=require("@mui/icons-material/Close"),a=require("@mui/icons-material/ArrowBack"),l=require("@mui/icons-material/NavigateBefore"),d=require("@mui/icons-material/NavigateNext"),c=require("@mui/icons-material/InfoOutlined"),u=require("@mui/icons-material/AutoFixHighOutlined"),x=require("@mui/icons-material/Check"),g=require("@mui/icons-material/Add"),f=require("@mui/icons-material/DeleteOutline"),p=require("@monaco-editor/react"),h=require("monaco-editor"),_=require("@mui/icons-material/DarkMode"),m=require("@mui/icons-material/LightMode");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function y(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(i){if("default"!==i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}}),n.default=e,Object.freeze(n)}var j=b(t),S=b(r),v=b(s),w=b(a),z=b(l),C=b(d),k=b(c),B=b(u),I=b(x),A=b(g),T=b(f),R=b(p),W=y(h),F=b(_),D=b(m),L={base:"vs-dark",inherit:!0,rules:[{token:"tag",foreground:"714be3",fontStyle:"bold"},{token:"attribute.name",foreground:"87CEFA"},{token:"attribute.value",foreground:"98FB98"},{token:"variable",foreground:"00FFFF"},{token:"delimiter",foreground:"888888"},{token:"white",foreground:"AAAAAA"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#030202","editorLineNumber.foreground":"#858585","editorCursor.foreground":"#FFFFFF","editorIndentGuide.background":"#404040","editorIndentGuide.activeBackground":"#707070"}},M={base:"vs",inherit:!0,rules:[{token:"tag",foreground:"5928ED",fontStyle:"bold"},{token:"attribute.name",foreground:"AF00DB"},{token:"attribute.value",foreground:"008000"},{token:"variable",foreground:"B000B0"},{token:"delimiter",foreground:"808080"},{token:"white",foreground:"000000"}],colors:{"editor.foreground":"#000000","editor.background":"#FFFFFF","editorLineNumber.foreground":"#999999","editorCursor.foreground":"#000000","editorIndentGuide.background":"#CCCCCC","editorIndentGuide.activeBackground":"#999999"}},O=function(t){var r=t.description,s=i.useState(!1),a=s[0],l=s[1],d=i.useState(!1),c=d[0],u=d[1],x=i.useRef(null);return i.useEffect(function(){var e=x.current;e&&u(e.scrollHeight>e.clientHeight+1)},[r,a]),n.jsxs(o.Box,e.__assign({sx:{mt:1.5,border:"1px solid #e5e7eb",borderRadius:2,bgcolor:"#fff",display:"flex",flexDirection:"column",px:1.25,py:1}},{children:[n.jsx(o.Typography,e.__assign({ref:x,component:"div",sx:e.__assign({fontSize:11,color:"#6b7280",lineHeight:1.5,overflowY:a?"auto":"hidden",maxHeight:a?"calc(1.6em * 5)":"calc(1.6em * 3)",whiteSpace:"normal",display:a?"block":"-webkit-box"},a?{}:{WebkitBoxOrient:"vertical",WebkitLineClamp:3})},{children:r})),c&&n.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return l(function(e){return!e})},sx:{mt:.75,alignSelf:"flex-end",fontSize:10,color:"#7c3aed",cursor:"pointer",fontWeight:500}},{children:a?"View less":"View more"}))]}))},E=function(t){var r=t.value,s=t.onChange,a=t.onDelete,l=i.useState(!1),d=l[0],c=l[1];return n.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"flex-start",gap:1,p:1,border:"1px solid #e5e7eb",borderRadius:"8px",bgcolor:"#fff"}},{children:[n.jsx(o.Box,e.__assign({sx:{width:18,height:18,borderRadius:"4px",bgcolor:"#f1f5f9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,color:"#64748b",flexShrink:0,mt:.1}},{children:"a"})),d?n.jsx(o.TextField,{autoFocus:!0,value:r,onChange:function(e){return s(e.target.value)},onBlur:function(){return c(!1)},size:"small",fullWidth:!0,multiline:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:12.5}}}):n.jsx(o.Typography,e.__assign({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55,flex:1}},{children:r})),n.jsxs(o.Stack,e.__assign({direction:"row",gap:.25,sx:{flexShrink:0}},{children:[n.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return c(!0)},sx:{color:"#6b7280"}},{children:n.jsx(S.default,{sx:{fontSize:14}})})),n.jsx(o.IconButton,e.__assign({size:"small",onClick:a,sx:{color:"#dc2626"}},{children:n.jsx(T.default,{sx:{fontSize:14}})}))]}))]}))},V=function(i){var t=i.isDarkMode,r=i.onChange;return n.jsx(o.Box,e.__assign({onClick:function(){return r(!t)},sx:{width:52,height:24,borderRadius:"12px",bgcolor:t?"#5928ed":"#f0f0f0",border:"1px solid",borderColor:t?"#5928ed":"#d1d5db",display:"flex",alignItems:"center",px:.4,cursor:"pointer",transition:"all 0.2s",justifyContent:t?"flex-end":"flex-start"}},{children:n.jsx(o.Box,e.__assign({sx:{width:18,height:18,borderRadius:"50%",bgcolor:t?"#1e1e2e":"#f59e0b",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"}},{children:t?n.jsx(F.default,{sx:{fontSize:11,color:"#fff"}}):n.jsx(D.default,{sx:{fontSize:11,color:"#fff"}})}))}))},P=function(t){var r=t.content,s=t.selectedTag,a=t.highlightVariable,l=t.isDarkMode,d=t.height,c=void 0===d?250:d,u=t.fontSize,x=void 0===u?12:u,g=i.useRef(),f=i.useRef();return i.useEffect(function(){if(s&&g.current&&f.current){var e=g.current,n=e.getModel();if(n){for(var i=n.getValue().split("\n"),o=-1,t=0;t<i.length;t++){var r=i[t].match(/<([^\s>\/]+(?:\s[^\s>\/]+)*)/);if(r&&r[1].trim().toLowerCase()===s.toLowerCase()){o=t+1;break}}if(o>0){var a=o,l="</".concat(s.toLowerCase(),">");for(t=o;t<i.length;t++)if(i[t].toLowerCase().includes(l)){a=t+1;break}e.setSelection(new f.current.Selection(o,1,o,1)),e.trigger(null,"editor.unfold",{}),e.revealLineInCenterIfOutsideViewport(o);var d=e.deltaDecorations([],[{range:new f.current.Range(o,1,a,i[a-1].length+1),options:{isWholeLine:!0,className:"promptemon-viewer-highlight",inlineClassName:"promptemon-viewer-highlight"}}]);setTimeout(function(){return e.deltaDecorations(d,[])},2e3)}}}},[s]),i.useEffect(function(){if(a&&g.current&&f.current){var e=g.current,n=e.getModel();if(n){for(var i=n.getValue().split("\n"),o=[],t=0;t<i.length;t++)for(var r=i[t].indexOf(a);-1!==r;)o.push(new W.Range(t+1,r+1,t+1,r+a.length+1)),r=i[t].indexOf(a,r+1);if(0!==o.length){e.revealLineInCenterIfOutsideViewport(o[0].startLineNumber);var s=e.deltaDecorations([],o.map(function(e){return{range:e,options:{inlineClassName:"promptemon-viewer-variable-highlight"}}}));setTimeout(function(){return e.deltaDecorations(s,[])},2e3)}}}},[a]),i.useEffect(function(){f.current&&f.current.editor.setTheme(l?"promptemonViewerDark":"promptemonViewerLight")},[l]),n.jsxs(n.Fragment,{children:[n.jsx("style",{children:"\n .promptemon-viewer-highlight { background-color: rgba(89, 40, 237, 0.15); }\n .promptemon-viewer-variable-highlight { background-color: rgba(0, 255, 255, 0.2); border-radius: 2px; }\n "}),n.jsxs(o.Box,e.__assign({sx:{width:"100%",height:c,display:"flex",flexDirection:"column"}},{children:[n.jsx(o.Box,{sx:{width:"100%",height:20,bgcolor:l?"#030202":"#fff",borderTopLeftRadius:8,borderTopRightRadius:8}}),n.jsx(o.Box,e.__assign({sx:{flex:1,minHeight:0,overflow:"hidden"}},{children:n.jsx(R.default,{onMount:function(e,n){g.current=e,f.current=n,n.editor.defineTheme("promptemonViewerDark",L),n.editor.defineTheme("promptemonViewerLight",M),n.editor.setTheme(l?"promptemonViewerDark":"promptemonViewerLight"),n.languages.register({id:"promptemonViewerLang"}),n.languages.setMonarchTokensProvider("promptemonViewerLang",{tokenizer:{root:[[/(<)([a-zA-Z0-9\-]+)(\s*)/,["delimiter","tag","white"],"@tagBody"],[/(<\/)([a-zA-Z0-9\-]+)(\s*)(>)/,["delimiter","tag","white","delimiter"]],[/{{[^}]+}}/,"variable"]],tagBody:[[/[a-zA-Z0-9\:\-]+(?=\=)/,"attribute.name"],[/=/,"delimiter"],[/(".*?"|'.*?')/,"attribute.value"],[/\s+/,"white"],[/(\/?>)/,{token:"delimiter",next:"@pop"}]]}}),n.languages.registerFoldingRangeProvider("promptemonViewerLang",{provideFoldingRanges:function(e){var n=e.getLinesContent(),i=[],o=[];return n.forEach(function(e,n){var t=n+1,r=e.match(/<([a-zA-Z0-9\-]+)(\s[^>]*)?>/),s=e.match(/<\/([a-zA-Z0-9\-]+)>/);if(r&&!e.includes("/>")&&o.push({tag:r[1],start:t}),s)for(var a=s[1],l=o.length-1;l>=0;l--)if(o[l].tag===a){i.push({start:o[l].start,end:t}),o.splice(l,1);break}}),i}})},beforeMount:function(e){e.editor.defineTheme("promptemonViewerDark",L),e.editor.defineTheme("promptemonViewerLight",M),e.editor.setTheme(l?"promptemonViewerDark":"promptemonViewerLight")},theme:l?"promptemonViewerDark":"promptemonViewerLight",value:r,language:"promptemonViewerLang",onChange:function(){},options:{fontSize:x,minimap:{enabled:!1},wordWrap:"on",lineNumbers:"on",readOnly:!0,domReadOnly:!0,scrollBeyondLastLine:!1,padding:{top:4,bottom:12},folding:!0,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:8}}})})),n.jsx(o.Box,{sx:{width:"100%",height:20,bgcolor:l?"#030202":"#fff",borderBottomLeftRadius:8,borderBottomRightRadius:8}})]}))]})},q=function(t){var r,s,a,l,d=t.block,c=t.isExtracted,u=t.isSaved,x=t.showEditMode,g=t.onBlockUpdate,f=t.onTagSelect,p=t.onVariableSelect,h=t.categories,_=t.subCategories,m=t.selectedCategoryId,b=t.selectedSubCategoryId,y=t.onCategoryChange,w=t.onSubCategoryChange,z=i.useState(!0),C=z[0],B=z[1],R=i.useState(!0),W=R[0],F=R[1],D=i.useState(!0),L=D[0],M=D[1],V=i.useState(!0),P=V[0],q=V[1],N=i.useState(!1),G=N[0],H=N[1],Z=i.useState(!0),U=Z[0],Y=Z[1],J=i.useState(!0),K=J[0],Q=J[1],X=i.useState(!1),$=X[0],ee=X[1],ne=i.useState(!1),ie=ne[0],oe=ne[1],te=i.useState(!1),re=te[0],se=te[1],ae=i.useState((null==d?void 0:d.title)||""),le=ae[0],de=ae[1],ce=i.useState((null==d?void 0:d.short_description)||""),ue=ce[0],xe=ce[1],ge=i.useState((null==d?void 0:d.members)||[]),fe=ge[0],pe=ge[1],he=i.useState(Array.isArray(null==d?void 0:d.when_to_apply)?d.when_to_apply:(null==d?void 0:d.when_to_apply)?[d.when_to_apply]:[]),_e=he[0],me=he[1],be=i.useState(Array.isArray(null==d?void 0:d.when_not_to_apply)?d.when_not_to_apply:(null==d?void 0:d.when_not_to_apply)?[d.when_not_to_apply]:[]),ye=be[0],je=be[1],Se=i.useState(!1),ve=Se[0],we=Se[1],ze=i.useState(""),Ce=ze[0],ke=ze[1],Be=i.useState(""),Ie=Be[0],Ae=Be[1],Te={boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"8px !important",mb:1.5,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 12px 0"}},Re={minHeight:44,px:2,borderRadius:2,"&.Mui-expanded":{minHeight:44},"& .MuiAccordionSummary-content":{my:"10px"}};return n.jsxs(o.Box,e.__assign({sx:{width:820,flexShrink:0,display:"flex",flexDirection:"column",overflow:"hidden",borderRight:"1px solid #e5e7eb"}},{children:[n.jsxs(o.Box,e.__assign({sx:{px:2.5,py:2,borderBottom:"1px solid #e5e7eb"}},{children:[n.jsxs(o.Stack,e.__assign({direction:"row",alignItems:"center",justifyContent:"space-between"},{children:[n.jsxs(o.Stack,e.__assign({direction:"row",alignItems:"center",gap:1,sx:{flex:1,minWidth:0}},{children:[n.jsx(o.Tooltip,e.__assign({title:"Functional Prompt Block",placement:"top"},{children:n.jsx(o.Chip,{label:"FPB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:11,height:22,borderRadius:1}})})),re?n.jsx(o.TextField,{value:le,onChange:function(e){return de(e.target.value)},size:"small",fullWidth:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:15,fontWeight:700,py:.5}}}):n.jsx(o.Typography,e.__assign({sx:{fontWeight:700,fontSize:15,color:"#111827"}},{children:(null==d?void 0:d.title)||"—"}))]})),re?n.jsxs(o.Stack,e.__assign({direction:"row",gap:.5},{children:[n.jsx(o.IconButton,e.__assign({size:"small",sx:{color:"#6b7280"},onClick:function(){return se(!1)}},{children:n.jsx(v.default,{sx:{fontSize:16}})})),n.jsx(o.IconButton,e.__assign({size:"small",sx:{color:"#16a34a"},onClick:function(){g(e.__assign(e.__assign({},d),{title:le,short_description:ue,members:fe,when_to_apply:_e,when_not_to_apply:ye})),se(!1)}},{children:n.jsx(I.default,{sx:{fontSize:16}})}))]})):!u&&x&&n.jsx(o.IconButton,e.__assign({size:"small",sx:{color:"#6b7280"},onClick:function(){de((null==d?void 0:d.title)||""),xe((null==d?void 0:d.short_description)||""),pe((null==d?void 0:d.members)||[]),me(Array.isArray(null==d?void 0:d.when_to_apply)?d.when_to_apply:(null==d?void 0:d.when_to_apply)?[d.when_to_apply]:[]),je(Array.isArray(null==d?void 0:d.when_not_to_apply)?d.when_not_to_apply:(null==d?void 0:d.when_not_to_apply)?[d.when_not_to_apply]:[]),se(!0)}},{children:n.jsx(S.default,{sx:{fontSize:16}})}))]})),re&&n.jsx(o.Typography,e.__assign({sx:{fontSize:11,color:"#5928ed",mt:.5}},{children:"Editing — changes won't be saved until you confirm"})),re?n.jsx(o.TextField,{value:ue,onChange:function(e){return xe(e.target.value)},size:"small",fullWidth:!0,multiline:!0,minRows:3,sx:{mt:1.5,"& .MuiOutlinedInput-input":{fontSize:12}}}):n.jsx(O,{description:(null==d?void 0:d.short_description)||"—"}),n.jsxs(o.Box,e.__assign({sx:{mt:1.5,border:"0.5px solid #d1d5db",borderRadius:"8px",display:"flex",overflow:"hidden"}},{children:[n.jsx(o.Box,e.__assign({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #d1d5db",p:.5}},{children:n.jsxs(o.Stack,e.__assign({direction:"row",alignItems:"center",gap:1},{children:[n.jsx(o.Typography,e.__assign({sx:{fontSize:10,color:"#87898d"}},{children:"Total APBs :"})),n.jsx(o.Typography,e.__assign({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(r=null==d?void 0:d.members)||void 0===r?void 0:r.length)||0}))]}))})),n.jsx(o.Box,e.__assign({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",p:.5}},{children:n.jsxs(o.Stack,e.__assign({direction:"row",alignItems:"center",gap:1},{children:[n.jsx(o.Typography,e.__assign({sx:{fontSize:10,color:"#87898d"}},{children:"Total Lines :"})),n.jsx(o.Typography,e.__assign({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(s=null==d?void 0:d.members)||void 0===s?void 0:s.reduce(function(e,n){var i,o;return e+((null!==(i=n.end_line)&&void 0!==i?i:0)-(null!==(o=n.start_line)&&void 0!==o?o:0)+1)},0))||0}))]}))}))]}))]})),n.jsxs(o.Box,e.__assign({sx:{flex:1,overflow:"auto",px:2,py:2,"&::-webkit-scrollbar":{width:4},"&::-webkit-scrollbar-thumb":{bgcolor:"#e5e7eb",borderRadius:2}}},{children:[n.jsxs(o.Accordion,e.__assign({expanded:C,onChange:function(){return B(function(e){return!e})},sx:Te,disableGutters:!0},{children:[n.jsx(o.AccordionSummary,e.__assign({expandIcon:n.jsx(j.default,{sx:{fontSize:18}}),sx:Re},{children:n.jsx(o.Typography,e.__assign({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Categories"}))})),n.jsx(o.AccordionDetails,e.__assign({sx:{pt:0,px:2,pb:2}},{children:n.jsxs(o.Stack,e.__assign({gap:1.5},{children:[n.jsxs(o.Box,{children:[n.jsx(o.Typography,e.__assign({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Category"})),re?n.jsx(o.Select,e.__assign({fullWidth:!0,size:"small",value:m,onChange:function(e){y(e.target.value),w("")},sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:h.map(function(i){return n.jsx(o.MenuItem,e.__assign({value:i.category_id},{children:i.category_name}),i.category_id)})})):n.jsx(o.TextField,{fullWidth:!0,size:"small",value:(null===(a=h.find(function(e){return e.category_id===m}))||void 0===a?void 0:a.category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]}),n.jsxs(o.Box,{children:[n.jsx(o.Typography,e.__assign({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Sub-Category"})),re?n.jsx(o.Select,e.__assign({fullWidth:!0,size:"small",value:b,onChange:function(e){return w(e.target.value)},disabled:!m,sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:_.filter(function(e){return e.category_id===m}).map(function(i){return n.jsx(o.MenuItem,e.__assign({value:i.sub_category_id},{children:i.sub_category_name}),i.sub_category_id)})})):n.jsx(o.TextField,{fullWidth:!0,size:"small",value:(null===(l=_.find(function(e){return e.sub_category_id===b}))||void 0===l?void 0:l.sub_category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]})]}))}))]})),n.jsxs(o.Accordion,e.__assign({expanded:W,onChange:function(){return F(function(e){return!e})},sx:Te,disableGutters:!0},{children:[n.jsx(o.AccordionSummary,e.__assign({expandIcon:n.jsx(j.default,{sx:{fontSize:18}}),sx:Re},{children:n.jsx(o.Typography,e.__assign({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Atomic Prompt Blocks (APBs)"}))})),n.jsxs(o.AccordionDetails,e.__assign({sx:{pt:0,px:1,pb:2}},{children:[n.jsx(o.Stack,e.__assign({gap:1},{children:(re?fe:(null==d?void 0:d.members)||[]).map(function(i,t){return n.jsxs(o.Box,e.__assign({sx:{px:2,py:1,borderRadius:2,bgcolor:"#fff"}},{children:[n.jsxs(o.Box,e.__assign({sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:1,gap:1}},{children:[n.jsxs(o.Typography,e.__assign({sx:{fontSize:14,fontWeight:500,color:"#111827"}},{children:[t+1,". ",i.section_name]})),re?n.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return pe(function(e){return e.filter(function(e,n){return n!==t})})},sx:{color:"#dc2626",flexShrink:0}},{children:n.jsx(T.default,{sx:{fontSize:16}})})):n.jsx(o.Box,e.__assign({onClick:function(){return f(i.section_name.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join("_"))},sx:{fontSize:14,color:"#475569",cursor:"pointer",flexShrink:0}},{children:"↗"}))]})),n.jsx(o.Typography,e.__assign({sx:{fontSize:12,lineHeight:1.5,color:"#64748b"}},{children:i.reason_for_inclusion})),c&&(r=i.segments||[],0===r.length?null:n.jsx(o.Box,e.__assign({sx:{mt:1}},{children:n.jsx(o.Box,e.__assign({sx:{display:"flex",flexWrap:"wrap",gap:1}},{children:r.map(function(e,i){return n.jsx(o.Chip,{clickable:!0,onClick:function(){return p(e.segmentized_text)},label:e.segmentized_text,sx:{borderRadius:1,bgcolor:"#eff6ff",color:"#3b82f6",border:"1px dashed #bfdbfe"}},i)})}))}))),n.jsx(o.Divider,{sx:{mt:2}})]}),t);var r})})),re&&n.jsxs(o.Box,e.__assign({onClick:function(){ke(""),Ae(""),we(!0)},sx:{mt:1,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:1,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:13,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[n.jsx(A.default,{sx:{fontSize:16}})," Add APB"]}))]}))]})),n.jsxs(o.Accordion,e.__assign({expanded:L,onChange:function(){return M(function(e){return!e})},sx:Te,disableGutters:!0},{children:[n.jsx(o.AccordionSummary,e.__assign({expandIcon:n.jsx(j.default,{sx:{fontSize:18}}),sx:Re},{children:n.jsxs(o.Typography,e.__assign({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Applicability ",n.jsx("span",e.__assign({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• When to apply / When not to apply"}))]}))})),n.jsxs(o.AccordionDetails,e.__assign({sx:{pt:0,px:1.5,pb:1.5}},{children:[n.jsxs(o.Accordion,e.__assign({expanded:P,onChange:function(){return q(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:1,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 8px 0"}},disableGutters:!0},{children:[n.jsx(o.AccordionSummary,e.__assign({expandIcon:n.jsx(j.default,{sx:{fontSize:16}}),sx:e.__assign(e.__assign({},Re),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:n.jsx(o.Typography,e.__assign({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When to Apply this FPB"}))})),n.jsx(o.AccordionDetails,e.__assign({sx:{pt:.5,px:2,pb:1.5}},{children:n.jsxs(o.Stack,e.__assign({gap:.75},{children:[(re?_e:Array.isArray(null==d?void 0:d.when_to_apply)?d.when_to_apply:(null==d?void 0:d.when_to_apply)?[d.when_to_apply]:["— Not yet available"]).map(function(i,t){return re?n.jsx(E,{value:i,onChange:function(e){return me(function(n){return n.map(function(n,i){return i===t?e:n})})},onDelete:function(){return me(function(e){return e.filter(function(e,n){return n!==t})})}},t):n.jsxs(o.Stack,e.__assign({direction:"row",gap:1,alignItems:"flex-start"},{children:[n.jsxs(o.Typography,e.__assign({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[t+1,"."]})),n.jsx(o.Typography,e.__assign({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:i}))]}),t)}),re&&n.jsxs(o.Box,e.__assign({onClick:function(){return me(function(n){return e.__spreadArray(e.__spreadArray([],n,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[n.jsx(A.default,{sx:{fontSize:15}})," Add When to Apply"]}))]}))}))]})),n.jsxs(o.Accordion,e.__assign({expanded:G,onChange:function(){return H(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important","&:before":{display:"none"}},disableGutters:!0},{children:[n.jsx(o.AccordionSummary,e.__assign({expandIcon:n.jsx(j.default,{sx:{fontSize:16}}),sx:e.__assign(e.__assign({},Re),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:n.jsx(o.Typography,e.__assign({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When NOT to Apply this FPB"}))})),n.jsx(o.AccordionDetails,e.__assign({sx:{pt:.5,px:2,pb:1.5}},{children:re?n.jsxs(o.Stack,e.__assign({gap:.75},{children:[ye.map(function(e,i){return n.jsx(E,{value:e,onChange:function(e){return je(function(n){return n.map(function(n,o){return o===i?e:n})})},onDelete:function(){return je(function(e){return e.filter(function(e,n){return n!==i})})}},i)}),n.jsxs(o.Box,e.__assign({onClick:function(){return je(function(n){return e.__spreadArray(e.__spreadArray([],n,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[n.jsx(A.default,{sx:{fontSize:15}})," Add When NOT to Apply"]}))]})):Array.isArray(null==d?void 0:d.when_not_to_apply)||(null==d?void 0:d.when_not_to_apply)?n.jsx(o.Stack,e.__assign({gap:.75},{children:(Array.isArray(null==d?void 0:d.when_not_to_apply)?d.when_not_to_apply:[d.when_not_to_apply]).map(function(i,t){return n.jsxs(o.Stack,e.__assign({direction:"row",gap:1,alignItems:"flex-start"},{children:[n.jsxs(o.Typography,e.__assign({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[t+1,"."]})),n.jsx(o.Typography,e.__assign({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:i}))]}),t)})})):n.jsx(o.Typography,e.__assign({sx:{fontSize:12.5,color:"#9ca3af",fontStyle:"italic"}},{children:"No conditions defined yet."}))}))]}))]}))]})),n.jsxs(o.Accordion,e.__assign({expanded:U,onChange:function(){return Y(function(e){return!e})},sx:Te,disableGutters:!0},{children:[n.jsx(o.AccordionSummary,e.__assign({expandIcon:n.jsx(j.default,{sx:{fontSize:18}}),sx:Re},{children:n.jsxs(o.Typography,e.__assign({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Specifications ",n.jsx("span",e.__assign({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• Strict Rules / Input / Output"}))]}))})),n.jsx(o.AccordionDetails,e.__assign({sx:{pt:0,px:1.5,pb:1.5}},{children:[{label:"Guidelines",expanded:K,setExpanded:Q,content:null==d?void 0:d.additional_guidelines},{label:"Input",expanded:$,setExpanded:ee,content:null},{label:"Output",expanded:ie,setExpanded:oe,content:null}].map(function(i,t){var r=i.label,s=i.expanded,a=i.setExpanded,l=i.content;return n.jsxs(o.Accordion,e.__assign({expanded:s,onChange:function(){return a(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:t<2?1:0,"&:before":{display:"none"},"&.Mui-expanded":{margin:t<2?"0 0 8px 0":0}},disableGutters:!0},{children:[n.jsx(o.AccordionSummary,e.__assign({expandIcon:n.jsx(j.default,{sx:{fontSize:16}}),sx:e.__assign(e.__assign({},Re),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:n.jsxs(o.Stack,e.__assign({direction:"row",alignItems:"center",gap:.5},{children:[n.jsx(o.Typography,e.__assign({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:r})),"Guidelines"!==r&&n.jsx(k.default,{sx:{fontSize:13,color:"#9ca3af"}})]}))})),n.jsx(o.AccordionDetails,e.__assign({sx:{pt:.5,px:2,pb:1.5}},{children:n.jsx(o.Typography,e.__assign({sx:{fontSize:12.5,color:l?"#374151":"#9ca3af",fontStyle:l?"normal":"italic"}},{children:l||"No ".concat(r.toLowerCase()," defined yet.")}))}))]}),r)})}))]}))]})),n.jsxs(o.Dialog,e.__assign({open:ve,onClose:function(){return we(!1)},maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:"12px"}}},{children:[n.jsxs(o.Box,e.__assign({sx:{px:3,py:2,display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e5e7eb"}},{children:[n.jsx(o.Typography,e.__assign({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Add new APB"})),n.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return we(!1)}},{children:n.jsx(v.default,{sx:{fontSize:"1.1rem",color:"#6b7280"}})}))]})),n.jsxs(o.Box,e.__assign({sx:{px:3,py:2.5,display:"flex",flexDirection:"column",gap:2}},{children:[n.jsxs(o.Box,{children:[n.jsx(o.Typography,e.__assign({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Title"})),n.jsx(o.TextField,{fullWidth:!0,size:"small",placeholder:"Specify the title of APB",value:Ce,onChange:function(e){return ke(e.target.value)}})]}),n.jsxs(o.Box,{children:[n.jsx(o.Typography,e.__assign({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Description"})),n.jsx(o.TextField,{fullWidth:!0,size:"small",multiline:!0,minRows:3,placeholder:"Describe the APB",value:Ie,onChange:function(e){return Ae(e.target.value)}})]})]})),n.jsxs(o.Box,e.__assign({sx:{px:3,py:2,display:"flex",justifyContent:"flex-end",gap:1,borderTop:"1px solid #e5e7eb"}},{children:[n.jsx(o.Button,e.__assign({variant:"outlined",onClick:function(){return we(!1)},sx:{textTransform:"none",borderColor:"#d1d5db",color:"#374151"}},{children:"Cancel"})),n.jsx(o.Button,e.__assign({variant:"contained",onClick:function(){pe(function(n){return e.__spreadArray(e.__spreadArray([],n,!0),[{section_name:Ce,reason_for_inclusion:Ie,content:""}],!1)}),we(!1)},sx:{textTransform:"none",bgcolor:"#5928ed","&:hover":{bgcolor:"#4c1d95"}}},{children:"Save"}))]}))]}))]}))};exports.default=function(t){var r,s,a,l,d,c=t.block,u=t.onBlockUpdate,x=t.isExtracting,g=t.isExtracted,f=t.onExtractSegments,p=t.isSaving,h=t.isSaved,_=t.onSave,m=t.onBack,b=t.title,y=void 0===b?"FPB Promptemon":b,j=t.categories,S=t.subCategories,k=t.selectedCategoryId,I=t.selectedSubCategoryId,A=t.onCategoryChange,T=t.onSubCategoryChange,R=t.showEditMode,W=void 0===R||R,F=t.showExtractSegments,D=void 0===F||F,L=i.useState(1),M=L[0],O=L[1],E=i.useState(!0),N=E[0],G=E[1],H=i.useState(""),Z=H[0],U=H[1],Y=i.useState(""),J=Y[0],K=Y[1],Q=(null===(r=null==c?void 0:c.members)||void 0===r?void 0:r.map(function(e){if(!g||!e.segments||0===e.segments.length)return e.content||"";var n=e.content||"";return e.segments.forEach(function(e){e.raw_text&&e.segmentized_text&&(n=n.split(e.raw_text).join(e.segmentized_text))}),n}).join("\n\n"))||"";return n.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",bgcolor:"#fff",overflow:"hidden"}},{children:[n.jsxs(o.Box,e.__assign({sx:{px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0}},{children:[n.jsxs(o.Stack,e.__assign({direction:"row",alignItems:"center",gap:1},{children:[n.jsx(o.IconButton,e.__assign({size:"small",sx:{color:"#6b7280"},onClick:m},{children:n.jsx(w.default,{sx:{fontSize:18}})})),n.jsx(o.Typography,e.__assign({sx:{fontSize:14,fontWeight:600,color:"#111827"}},{children:y}))]})),n.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1}},{children:[n.jsx(o.Button,e.__assign({variant:"contained",size:"small",disabled:!g||p||h,onClick:_,sx:{textTransform:"none",fontSize:"0.78rem",fontWeight:600,bgcolor:"#5928ed",px:2,py:.6,"&:hover":{bgcolor:"#4c1d95"},"&.Mui-disabled":{bgcolor:"#5928ed",color:"#fff",opacity:.4}}},{children:p?"Saving...":h?"Saved ✓":"Save FPB"})),n.jsx(o.IconButton,e.__assign({size:"small",sx:{color:"#6b7280"},onClick:m},{children:n.jsx(v.default,{sx:{fontSize:18}})}))]}))]})),n.jsxs(o.Box,e.__assign({sx:{display:"flex",flex:1,overflow:"hidden"}},{children:[n.jsx(q,{block:c,isExtracted:g,isSaved:h,showEditMode:W,onBlockUpdate:u,onTagSelect:function(e){U(""),setTimeout(function(){return U(e)},50)},onVariableSelect:function(e){K(""),setTimeout(function(){return K(e)},50)},categories:j,subCategories:S,selectedCategoryId:k,selectedSubCategoryId:I,onCategoryChange:A,onSubCategoryChange:T}),n.jsxs(o.Box,e.__assign({sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5}},{children:[n.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[n.jsxs(o.Stack,e.__assign({direction:"row",alignItems:"center",gap:1},{children:[n.jsxs(o.Typography,e.__assign({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:[(null==c?void 0:c.title)||"—"," APBs"]})),n.jsxs(o.Stack,e.__assign({direction:"row",alignItems:"center",gap:.5},{children:[n.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return O(function(e){return Math.max(1,e-1)})},disabled:1===M,sx:{color:"#6b7280",p:.4}},{children:n.jsx(z.default,{sx:{fontSize:16}})})),n.jsxs(o.Typography,e.__assign({sx:{fontSize:12.5,color:"#6b7280"}},{children:[M," of ",(null===(s=null==c?void 0:c.members)||void 0===s?void 0:s.length)||0]})),n.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return O(function(e){var n;return Math.min((null===(n=null==c?void 0:c.members)||void 0===n?void 0:n.length)||0,e+1)})},disabled:M===((null===(a=null==c?void 0:c.members)||void 0===a?void 0:a.length)||0),sx:{color:"#6b7280",p:.4}},{children:n.jsx(C.default,{sx:{fontSize:16}})}))]}))]})),n.jsx(o.Stack,e.__assign({direction:"row",alignItems:"center",gap:1.5},{children:D&&(g?n.jsxs(o.Stack,e.__assign({direction:"row",alignItems:"center",gap:1},{children:[n.jsx(o.Typography,e.__assign({sx:{fontSize:12.5,color:"#6b7280"}},{children:"Show Segments"})),n.jsx(o.Box,e.__assign({sx:{width:36,height:20,borderRadius:"10px",bgcolor:"#7c3aed",display:"flex",alignItems:"center",px:.3,cursor:"pointer"}},{children:n.jsx(o.Box,{sx:{width:14,height:14,borderRadius:"50%",bgcolor:"#fff",ml:"auto"}})}))]})):n.jsxs(o.Box,e.__assign({onClick:f,sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.85,borderRadius:1.5,bgcolor:"#7c3aed",cursor:x?"default":"pointer","&:hover":{bgcolor:"#6d28d9"},userSelect:"none",opacity:x?.7:1}},{children:[n.jsx(B.default,{sx:{fontSize:15,color:"#fff"}}),n.jsx(o.Typography,e.__assign({sx:{fontSize:13,fontWeight:600,color:"#fff"}},{children:x?"Extracting...":"Extract Segments"}))]})))}))]})),n.jsxs(o.Box,e.__assign({sx:{flex:1,minHeight:0,position:"relative"}},{children:[x&&n.jsx(o.Box,e.__assign({sx:{position:"absolute",top:0,left:0,right:0,bottom:0,bgcolor:"rgba(0,0,0,0.6)",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:1}},{children:n.jsx(o.Typography,e.__assign({sx:{color:"#fff",fontSize:14,fontWeight:600}},{children:"Extracting segments..."}))})),n.jsxs(o.Box,e.__assign({sx:{border:"1px solid #30363d",borderRadius:1,overflow:"hidden",height:"100%"}},{children:[n.jsxs(o.Box,e.__assign({sx:{px:2,py:1,borderBottom:"1px solid #30363d",display:"flex",alignItems:"center",gap:1,bgcolor:"#161b22",flexShrink:0}},{children:[n.jsx(o.Box,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#ff5f57"}}),n.jsx(o.Box,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#febc2e"}}),n.jsx(o.Box,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#28c840"}}),n.jsxs(o.Typography,e.__assign({sx:{ml:1,fontSize:11,color:"#8b949e",fontFamily:"monospace"}},{children:[(null===(d=null===(l=null==c?void 0:c.members)||void 0===l?void 0:l[M-1])||void 0===d?void 0:d.section_name)||"—",".xml"]})),n.jsx(o.Box,{sx:{flex:1}}),n.jsx(V,{isDarkMode:N,onChange:G})]})),n.jsx(P,{content:Q,selectedTag:Z,highlightVariable:J,isDarkMode:N,height:"100%",fontSize:14})]}))]}))]}))]}))]}))};
|
|
2
|
+
//# sourceMappingURL=PromptemonViewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptemonViewer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),o=require("./features/Bookemon/Bookemon.js"),r=require("./features/PdfEditorCitation/PdfEditorCitation.js"),n=require("./features/CitationRenderer/CitationRenderer.js"),a=require("./features/CitationRenderer/MarkdownRenderer.js"),s=require("./features/CodeCitation/_components/CodeEditor.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),o=require("./features/Bookemon/Bookemon.js"),r=require("./features/PdfEditorCitation/PdfEditorCitation.js"),n=require("./features/CitationRenderer/CitationRenderer.js"),a=require("./features/CitationRenderer/MarkdownRenderer.js"),s=require("./features/CodeCitation/_components/CodeEditor.js"),u=require("./features/PaginatedTable/PaginatedTable.js"),C=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js"),p=require("./features/ChatCitation/ChatCitationRenderer.js"),l=require("./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js"),d=require("./features/PdfViewer/PdfViewer.js"),f=require("./features/CognitiveDecisioning/FaqCitation/FaqCitation.js"),x=require("./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js"),g=require("./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js"),m=require("./features/RequirementAiCitations/FileCitation/FileCitationContent.js"),c=require("./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js"),q=require("./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js"),j=require("./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js"),R=require("./features/TableCitation/TableCitationContent.js"),S=require("./features/CitationViewer/CitationsViewer.js"),w=require("./features/ExcelCitation/ExcelCitations.js"),I=require("./features/ScannedDocCitation/ScannedDocCitation.js"),T=require("./features/ChatDrawer/ChatDrawer.js"),D=require("./features/ChatDrawer/constants/ChatDrawer.js"),P=require("./features/SplitterCitations/SplitterCitationsComponent.js"),b=require("./features/DualCitation/SourceBQDataCompnent.js"),E=require("./features/CognitiveCompare/CognitiveCompare.js"),V=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),A=require("./features/TextualGuidelines/TextualGuideLinesComponent.js"),W=require("./features/RulebookCitations/RuleBookCitationWrapper.js"),h=require("./features/IngestionStatus/IngestionStatusComponent.js"),k=require("./features/ManageRemainders/ManageReminders.js"),v=require("./features/PromptemonBlockViewer/PromptemonBlockViewer.js"),B=require("./features/PromptemonViewer/PromptemonViewer.js"),F=require("./features/GptWebCitation/GptWebCitation.js"),G=require("./hooks/useOnDemandCitationFetch.js"),U=require("./features/InstantLearningCitation/InstantLearningCitationComponent.js"),_=require("./features/BPACitationRenderer/BPACitationRenderer.js"),M=require("./features/GptWebCitation/utils/citationData.utils.js"),L=require("./features/GptWebCitation/types.js");exports.CodeCitation=e.default,exports.ProjectAccordian=t.default,exports.BookCitation=i.default,exports.Bookemon=o.default,exports.PdfCitation=r.PdfEditorCitation,exports.CitationRenderer=n.default,exports.MarkdownRenderer=a.default,Object.defineProperty(exports,"DiagnosticSeverity",{enumerable:!0,get:function(){return s.DiagnosticSeverity}}),exports.PaginatedTable=u.default,exports.InternalgptReasoningComponent=C.default,exports.NonWebReasoningComponent=C.default,exports.ChatCitation=p.default,exports.CognitiveDecisioningCard=l.default,exports.PdfViewer=d.default,exports.FaqCitation=f.default,exports.ImageCitationContent=x.default,exports.VideoCitationContent=g.default,exports.FileCitationContent=m.default,exports.WebCitationWithImageContent=c.default,exports.MarkdownWithImageCitation=q.default,exports.AiReasoningCitation=j.default,exports.TableCitationContent=R.default,exports.CitationsViewer=S.default,exports.ExcelCitation=w.default,exports.ScannedDocCitation=I.default,exports.ChatDrawer=T.default,exports.FILE_INGESTION_STATUS=D.FILE_INGESTION_STATUS,exports.SUMMARY_EXPAND_HEIGHT_NUDGE=D.SUMMARY_EXPAND_HEIGHT_NUDGE,exports.TRUNCATE_THRESHOLD=D.TRUNCATE_THRESHOLD,exports.SplitterCitationsComponent=P.default,exports.SourcesBQCitation=b.SourcesBQCitation,exports.findSourceCitation=b.findSourceCitation,exports.parseSourcesBQHref=b.parseSourcesBQHref,exports.CognitiveCompare=E.default,exports.CognitiveInternalgptCoreComponent=V.default,exports.TextualGuideLinesComponent=A.default,exports.RuleBookCitationWrapper=W.default,exports.IngestionStatusChip=h.IngestionStatusChip,exports.IngestionStatusComponent=h.IngestionStatusComponent,exports.ManageReminders=k.ManageReminders,exports.PromptemonBlockViewer=v.default,exports.PromptemonViewer=B.default,exports.GptWebCitation=F.default,exports.useOnDemandCitationFetch=G.useOnDemandCitationFetch,exports.InstantLearningCitationWrapper=U.default,exports.BPACitationRenderer=_.default,exports.extractLearnedFromUrl=M.extractLearnedFromUrl,exports.extractRelevanceScoreFromContent=M.extractRelevanceScoreFromContent,exports.extractTopicFromContent=M.extractTopicFromContent,exports.getWebCitationImageUrl=M.getWebCitationImageUrl,exports.mapCitationDataToDisplay=M.mapCitationDataToDisplay,exports.resolveSkeletonVisitUrl=M.resolveSkeletonVisitUrl,exports.sanitizeExternalUrl=M.sanitizeExternalUrl,Object.defineProperty(exports,"CitationType",{enumerable:!0,get:function(){return L.CitationType}}),exports.allowsGptCitationView=L.allowsGptCitationView,exports.allowsWebCitationView=L.allowsWebCitationView,exports.showsCitationViewToggle=L.showsCitationViewToggle;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as r,Fragment as o,jsx as t}from"react/jsx-runtime";import{useState as i,useRef as n,useEffect as l}from"react";import{Box as a,Typography as d,Tooltip as s,Dialog as c,IconButton as f,Chip as h}from"@mui/material";import g from"@mui/icons-material/Close";import m from"@mui/icons-material/Fullscreen";import u from"@monaco-editor/react";import*as p from"monaco-editor";import b from"@mui/icons-material/DarkMode";import x from"@mui/icons-material/LightMode";var v={base:"vs-dark",inherit:!0,rules:[{token:"tag",foreground:"714be3",fontStyle:"bold"},{token:"attribute.name",foreground:"87CEFA"},{token:"attribute.value",foreground:"98FB98"},{token:"variable",foreground:"00FFFF"},{token:"delimiter",foreground:"888888"},{token:"white",foreground:"AAAAAA"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#030202","editorLineNumber.foreground":"#858585","editorCursor.foreground":"#FFFFFF","editorIndentGuide.background":"#404040","editorIndentGuide.activeBackground":"#707070"}},k={base:"vs",inherit:!0,rules:[{token:"tag",foreground:"5928ED",fontStyle:"bold"},{token:"attribute.name",foreground:"AF00DB"},{token:"attribute.value",foreground:"008000"},{token:"variable",foreground:"B000B0"},{token:"delimiter",foreground:"808080"},{token:"white",foreground:"000000"}],colors:{"editor.foreground":"#000000","editor.background":"#FFFFFF","editorLineNumber.foreground":"#999999","editorCursor.foreground":"#000000","editorIndentGuide.background":"#CCCCCC","editorIndentGuide.activeBackground":"#999999"}},w=function(r){var o=r.isDarkMode,i=r.onChange;return t(a,e({onClick:function(){return i(!o)},sx:{width:52,height:24,borderRadius:"12px",bgcolor:o?"#5928ed":"#f0f0f0",border:"1px solid",borderColor:o?"#5928ed":"#d1d5db",display:"flex",alignItems:"center",px:.4,cursor:"pointer",transition:"all 0.2s",justifyContent:o?"flex-end":"flex-start"}},{children:t(a,e({sx:{width:18,height:18,borderRadius:"50%",bgcolor:o?"#1e1e2e":"#f59e0b",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"}},{children:t(o?b:x,{sx:{fontSize:11,color:"#fff"}})}))}))},C=function(i){var d=i.content,s=i.selectedTag,c=i.highlightVariable,f=i.isDarkMode,h=i.height,g=void 0===h?250:h,m=i.fontSize,b=void 0===m?12:m,x=n(),w=n();return l(function(){if(s&&x.current&&w.current){var e=x.current,r=e.getModel();if(r){for(var o=r.getValue().split("\n"),t=-1,i=0;i<o.length;i++){var n=o[i].match(/<([^\s>\/]+(?:\s[^\s>\/]+)*)/);if(n&&n[1].trim().toLowerCase()===s.toLowerCase()){t=i+1;break}}if(t>0){var l=t,a="</".concat(s.toLowerCase(),">");for(i=t;i<o.length;i++)if(o[i].toLowerCase().includes(a)){l=i+1;break}e.setSelection(new w.current.Selection(t,1,t,1)),e.trigger(null,"editor.unfold",{}),e.revealLineInCenterIfOutsideViewport(t);var d=e.deltaDecorations([],[{range:new w.current.Range(t,1,l,o[l-1].length+1),options:{isWholeLine:!0,className:"promptemon-highlight",inlineClassName:"promptemon-highlight"}}]);setTimeout(function(){return e.deltaDecorations(d,[])},2e3)}}}},[s]),l(function(){if(c&&x.current&&w.current){var e=x.current,r=e.getModel();if(r){for(var o=r.getValue().split("\n"),t=[],i=0;i<o.length;i++)for(var n=o[i].indexOf(c);-1!==n;)t.push(new p.Range(i+1,n+1,i+1,n+c.length+1)),n=o[i].indexOf(c,n+1);if(0!==t.length){e.revealLineInCenterIfOutsideViewport(t[0].startLineNumber);var l=e.deltaDecorations([],t.map(function(e){return{range:e,options:{inlineClassName:"promptemon-variable-highlight"}}}));setTimeout(function(){return e.deltaDecorations(l,[])},2e3)}}}},[c]),l(function(){w.current&&w.current.editor.setTheme(f?"promptemonDark":"promptemonLight")},[f]),r(o,{children:[t("style",{children:"\n .promptemon-highlight { background-color: rgba(89, 40, 237, 0.15); }\n .promptemon-variable-highlight { background-color: rgba(0, 255, 255, 0.2); border-radius: 2px; }\n "}),r(a,e({sx:{width:"100%",height:g,display:"flex",flexDirection:"column"}},{children:[t(a,{sx:{width:"100%",height:20,bgcolor:f?"#030202":"#fff",borderTopLeftRadius:8,borderTopRightRadius:8}}),t(a,e({sx:{flex:1,minHeight:0,overflow:"hidden"}},{children:t(u,{onMount:function(e,r){x.current=e,w.current=r,r.editor.defineTheme("promptemonDark",v),r.editor.defineTheme("promptemonLight",k),r.editor.setTheme(f?"promptemonDark":"promptemonLight"),r.languages.register({id:"promptemonLang"}),r.languages.setMonarchTokensProvider("promptemonLang",{tokenizer:{root:[[/(<)([a-zA-Z0-9\-]+)(\s*)/,["delimiter","tag","white"],"@tagBody"],[/(<\/)([a-zA-Z0-9\-]+)(\s*)(>)/,["delimiter","tag","white","delimiter"]],[/{{[^}]+}}/,"variable"]],tagBody:[[/[a-zA-Z0-9\:\-]+(?=\=)/,"attribute.name"],[/=/,"delimiter"],[/(".*?"|'.*?')/,"attribute.value"],[/\s+/,"white"],[/(\/?>)/,{token:"delimiter",next:"@pop"}]]}}),r.languages.registerFoldingRangeProvider("promptemonLang",{provideFoldingRanges:function(e){var r=e.getLinesContent(),o=[],t=[];return r.forEach(function(e,r){var i=r+1,n=e.match(/<([a-zA-Z0-9\-]+)(\s[^>]*)?>/),l=e.match(/<\/([a-zA-Z0-9\-]+)>/);if(n&&!e.includes("/>")&&t.push({tag:n[1],start:i}),l)for(var a=l[1],d=t.length-1;d>=0;d--)if(t[d].tag===a){o.push({start:t[d].start,end:i}),t.splice(d,1);break}}),o}})},beforeMount:function(e){e.editor.defineTheme("promptemonDark",v),e.editor.defineTheme("promptemonLight",k),e.editor.setTheme(f?"promptemonDark":"promptemonLight")},theme:f?"promptemonDark":"promptemonLight",value:d,language:"promptemonLang",onChange:function(){},options:{fontSize:b,minimap:{enabled:!1},wordWrap:"on",lineNumbers:"on",readOnly:!0,domReadOnly:!0,scrollBeyondLastLine:!1,padding:{top:4,bottom:12},folding:!0,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:8}}})})),t(a,{sx:{width:"100%",height:20,bgcolor:f?"#030202":"#fff",borderBottomLeftRadius:8,borderBottomRightRadius:8}})]}))]})},y=function(n){var l=n.title,u=n.description,p=n.content,b=n.height,x=void 0===b?250:b,v=n.selectedTag,k=n.highlightVariable,y=i(!0),F=y[0],L=y[1],z=i(!1),D=z[0],B=z[1];return r(o,{children:[r(a,e({sx:{border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:[r(a,e({sx:{px:1.5,py:.75,bgcolor:"#f9fafb",borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t(d,e({sx:{fontSize:"0.72rem",color:"#374151",fontWeight:600}},{children:l})),r(a,e({sx:{display:"flex",alignItems:"center",gap:.75}},{children:[t(w,{isDarkMode:F,onChange:L}),t(s,e({title:"Fullscreen",placement:"top"},{children:t(a,e({onClick:function(){return B(!0)},sx:{cursor:"pointer",display:"flex",alignItems:"center",p:.3,borderRadius:"4px","&:hover":{bgcolor:"#e5e7eb"}}},{children:t(m,{sx:{fontSize:"0.9rem",color:"#6b7280"}})}))}))]}))]})),t(a,e({sx:{height:x,bgcolor:F?"#030202":"#fff"}},{children:t(C,{content:p,selectedTag:v,highlightVariable:k,isDarkMode:F,height:x,fontSize:12})}))]})),r(c,e({open:D,onClose:function(){return B(!1)},maxWidth:!1,PaperProps:{sx:{width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"}}},{children:[r(a,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[t(d,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:l})),t(f,e({size:"small",onClick:function(){return B(!1)}},{children:t(g,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),r(a,e({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[u&&r(a,e({sx:{width:"35%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[r(a,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[t(h,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}}),t(d,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:l}))]})),t(a,e({sx:{flex:1,p:2,overflowY:"auto"}},{children:r(a,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[t(d,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),t(d,e({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:u}))]}))}))]})),r(a,e({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[r(a,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t(d,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),t(w,{isDarkMode:F,onChange:L})]})),t(a,e({sx:{flex:1,minHeight:0,p:1.5}},{children:t(C,{content:p,selectedTag:v,highlightVariable:k,isDarkMode:F,height:"100%",fontSize:13})}))]}))]}))]}))]})};export{y as default};
|
|
2
|
+
//# sourceMappingURL=PromptemonBlockViewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptemonBlockViewer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as o,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as r,useRef as l,useEffect as d}from"react";import{Box as a,Stack as c,IconButton as s,Typography as u,Button as f,Tooltip as p,Chip as h,TextField as g,Accordion as m,AccordionSummary as x,AccordionDetails as b,Select as v,MenuItem as y,Divider as w,Dialog as S}from"@mui/material";import z from"@mui/icons-material/ExpandMore";import C from"@mui/icons-material/EditOutlined";import _ from"@mui/icons-material/Close";import k from"@mui/icons-material/ArrowBack";import I from"@mui/icons-material/NavigateBefore";import W from"@mui/icons-material/NavigateNext";import R from"@mui/icons-material/InfoOutlined";import A from"@mui/icons-material/AutoFixHighOutlined";import B from"@mui/icons-material/Check";import F from"@mui/icons-material/Add";import L from"@mui/icons-material/DeleteOutline";import D from"@monaco-editor/react";import*as M from"monaco-editor";import T from"@mui/icons-material/DarkMode";import V from"@mui/icons-material/LightMode";var E={base:"vs-dark",inherit:!0,rules:[{token:"tag",foreground:"714be3",fontStyle:"bold"},{token:"attribute.name",foreground:"87CEFA"},{token:"attribute.value",foreground:"98FB98"},{token:"variable",foreground:"00FFFF"},{token:"delimiter",foreground:"888888"},{token:"white",foreground:"AAAAAA"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#030202","editorLineNumber.foreground":"#858585","editorCursor.foreground":"#FFFFFF","editorIndentGuide.background":"#404040","editorIndentGuide.activeBackground":"#707070"}},O={base:"vs",inherit:!0,rules:[{token:"tag",foreground:"5928ED",fontStyle:"bold"},{token:"attribute.name",foreground:"AF00DB"},{token:"attribute.value",foreground:"008000"},{token:"variable",foreground:"B000B0"},{token:"delimiter",foreground:"808080"},{token:"white",foreground:"000000"}],colors:{"editor.foreground":"#000000","editor.background":"#FFFFFF","editorLineNumber.foreground":"#999999","editorCursor.foreground":"#000000","editorIndentGuide.background":"#CCCCCC","editorIndentGuide.activeBackground":"#999999"}},P=function(n){var i=n.description,c=r(!1),s=c[0],f=c[1],p=r(!1),h=p[0],g=p[1],m=l(null);return d(function(){var e=m.current;e&&g(e.scrollHeight>e.clientHeight+1)},[i,s]),o(a,e({sx:{mt:1.5,border:"1px solid #e5e7eb",borderRadius:2,bgcolor:"#fff",display:"flex",flexDirection:"column",px:1.25,py:1}},{children:[t(u,e({ref:m,component:"div",sx:e({fontSize:11,color:"#6b7280",lineHeight:1.5,overflowY:s?"auto":"hidden",maxHeight:s?"calc(1.6em * 5)":"calc(1.6em * 3)",whiteSpace:"normal",display:s?"block":"-webkit-box"},s?{}:{WebkitBoxOrient:"vertical",WebkitLineClamp:3})},{children:i})),h&&t(u,e({component:"span",onClick:function(){return f(function(e){return!e})},sx:{mt:.75,alignSelf:"flex-end",fontSize:10,color:"#7c3aed",cursor:"pointer",fontWeight:500}},{children:s?"View less":"View more"}))]}))},j=function(n){var i=n.value,l=n.onChange,d=n.onDelete,f=r(!1),p=f[0],h=f[1];return o(a,e({sx:{display:"flex",alignItems:"flex-start",gap:1,p:1,border:"1px solid #e5e7eb",borderRadius:"8px",bgcolor:"#fff"}},{children:[t(a,e({sx:{width:18,height:18,borderRadius:"4px",bgcolor:"#f1f5f9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,color:"#64748b",flexShrink:0,mt:.1}},{children:"a"})),p?t(g,{autoFocus:!0,value:i,onChange:function(e){return l(e.target.value)},onBlur:function(){return h(!1)},size:"small",fullWidth:!0,multiline:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:12.5}}}):t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55,flex:1}},{children:i})),o(c,e({direction:"row",gap:.25,sx:{flexShrink:0}},{children:[t(s,e({size:"small",onClick:function(){return h(!0)},sx:{color:"#6b7280"}},{children:t(C,{sx:{fontSize:14}})})),t(s,e({size:"small",onClick:d,sx:{color:"#dc2626"}},{children:t(L,{sx:{fontSize:14}})}))]}))]}))},N=function(n){var o=n.isDarkMode,i=n.onChange;return t(a,e({onClick:function(){return i(!o)},sx:{width:52,height:24,borderRadius:"12px",bgcolor:o?"#5928ed":"#f0f0f0",border:"1px solid",borderColor:o?"#5928ed":"#d1d5db",display:"flex",alignItems:"center",px:.4,cursor:"pointer",transition:"all 0.2s",justifyContent:o?"flex-end":"flex-start"}},{children:t(a,e({sx:{width:18,height:18,borderRadius:"50%",bgcolor:o?"#1e1e2e":"#f59e0b",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"}},{children:t(o?T:V,{sx:{fontSize:11,color:"#fff"}})}))}))},G=function(n){var r=n.content,c=n.selectedTag,s=n.highlightVariable,u=n.isDarkMode,f=n.height,p=void 0===f?250:f,h=n.fontSize,g=void 0===h?12:h,m=l(),x=l();return d(function(){if(c&&m.current&&x.current){var e=m.current,n=e.getModel();if(n){for(var o=n.getValue().split("\n"),t=-1,i=0;i<o.length;i++){var r=o[i].match(/<([^\s>\/]+(?:\s[^\s>\/]+)*)/);if(r&&r[1].trim().toLowerCase()===c.toLowerCase()){t=i+1;break}}if(t>0){var l=t,d="</".concat(c.toLowerCase(),">");for(i=t;i<o.length;i++)if(o[i].toLowerCase().includes(d)){l=i+1;break}e.setSelection(new x.current.Selection(t,1,t,1)),e.trigger(null,"editor.unfold",{}),e.revealLineInCenterIfOutsideViewport(t);var a=e.deltaDecorations([],[{range:new x.current.Range(t,1,l,o[l-1].length+1),options:{isWholeLine:!0,className:"promptemon-viewer-highlight",inlineClassName:"promptemon-viewer-highlight"}}]);setTimeout(function(){return e.deltaDecorations(a,[])},2e3)}}}},[c]),d(function(){if(s&&m.current&&x.current){var e=m.current,n=e.getModel();if(n){for(var o=n.getValue().split("\n"),t=[],i=0;i<o.length;i++)for(var r=o[i].indexOf(s);-1!==r;)t.push(new M.Range(i+1,r+1,i+1,r+s.length+1)),r=o[i].indexOf(s,r+1);if(0!==t.length){e.revealLineInCenterIfOutsideViewport(t[0].startLineNumber);var l=e.deltaDecorations([],t.map(function(e){return{range:e,options:{inlineClassName:"promptemon-viewer-variable-highlight"}}}));setTimeout(function(){return e.deltaDecorations(l,[])},2e3)}}}},[s]),d(function(){x.current&&x.current.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight")},[u]),o(i,{children:[t("style",{children:"\n .promptemon-viewer-highlight { background-color: rgba(89, 40, 237, 0.15); }\n .promptemon-viewer-variable-highlight { background-color: rgba(0, 255, 255, 0.2); border-radius: 2px; }\n "}),o(a,e({sx:{width:"100%",height:p,display:"flex",flexDirection:"column"}},{children:[t(a,{sx:{width:"100%",height:20,bgcolor:u?"#030202":"#fff",borderTopLeftRadius:8,borderTopRightRadius:8}}),t(a,e({sx:{flex:1,minHeight:0,overflow:"hidden"}},{children:t(D,{onMount:function(e,n){m.current=e,x.current=n,n.editor.defineTheme("promptemonViewerDark",E),n.editor.defineTheme("promptemonViewerLight",O),n.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight"),n.languages.register({id:"promptemonViewerLang"}),n.languages.setMonarchTokensProvider("promptemonViewerLang",{tokenizer:{root:[[/(<)([a-zA-Z0-9\-]+)(\s*)/,["delimiter","tag","white"],"@tagBody"],[/(<\/)([a-zA-Z0-9\-]+)(\s*)(>)/,["delimiter","tag","white","delimiter"]],[/{{[^}]+}}/,"variable"]],tagBody:[[/[a-zA-Z0-9\:\-]+(?=\=)/,"attribute.name"],[/=/,"delimiter"],[/(".*?"|'.*?')/,"attribute.value"],[/\s+/,"white"],[/(\/?>)/,{token:"delimiter",next:"@pop"}]]}}),n.languages.registerFoldingRangeProvider("promptemonViewerLang",{provideFoldingRanges:function(e){var n=e.getLinesContent(),o=[],t=[];return n.forEach(function(e,n){var i=n+1,r=e.match(/<([a-zA-Z0-9\-]+)(\s[^>]*)?>/),l=e.match(/<\/([a-zA-Z0-9\-]+)>/);if(r&&!e.includes("/>")&&t.push({tag:r[1],start:i}),l)for(var d=l[1],a=t.length-1;a>=0;a--)if(t[a].tag===d){o.push({start:t[a].start,end:i}),t.splice(a,1);break}}),o}})},beforeMount:function(e){e.editor.defineTheme("promptemonViewerDark",E),e.editor.defineTheme("promptemonViewerLight",O),e.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight")},theme:u?"promptemonViewerDark":"promptemonViewerLight",value:r,language:"promptemonViewerLang",onChange:function(){},options:{fontSize:g,minimap:{enabled:!1},wordWrap:"on",lineNumbers:"on",readOnly:!0,domReadOnly:!0,scrollBeyondLastLine:!1,padding:{top:4,bottom:12},folding:!0,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:8}}})})),t(a,{sx:{width:"100%",height:20,bgcolor:u?"#030202":"#fff",borderBottomLeftRadius:8,borderBottomRightRadius:8}})]}))]})},H=function(i){var l,d,k,I,W=i.block,A=i.isExtracted,D=i.isSaved,M=i.showEditMode,T=i.onBlockUpdate,V=i.onTagSelect,E=i.onVariableSelect,O=i.categories,N=i.subCategories,G=i.selectedCategoryId,H=i.selectedSubCategoryId,Z=i.onCategoryChange,U=i.onSubCategoryChange,Y=r(!0),q=Y[0],J=Y[1],K=r(!0),Q=K[0],X=K[1],$=r(!0),ee=$[0],ne=$[1],oe=r(!0),te=oe[0],ie=oe[1],re=r(!1),le=re[0],de=re[1],ae=r(!0),ce=ae[0],se=ae[1],ue=r(!0),fe=ue[0],pe=ue[1],he=r(!1),ge=he[0],me=he[1],xe=r(!1),be=xe[0],ve=xe[1],ye=r(!1),we=ye[0],Se=ye[1],ze=r((null==W?void 0:W.title)||""),Ce=ze[0],_e=ze[1],ke=r((null==W?void 0:W.short_description)||""),Ie=ke[0],We=ke[1],Re=r((null==W?void 0:W.members)||[]),Ae=Re[0],Be=Re[1],Fe=r(Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:[]),Le=Fe[0],De=Fe[1],Me=r(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:(null==W?void 0:W.when_not_to_apply)?[W.when_not_to_apply]:[]),Te=Me[0],Ve=Me[1],Ee=r(!1),Oe=Ee[0],Pe=Ee[1],je=r(""),Ne=je[0],Ge=je[1],He=r(""),Ze=He[0],Ue=He[1],Ye={boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"8px !important",mb:1.5,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 12px 0"}},qe={minHeight:44,px:2,borderRadius:2,"&.Mui-expanded":{minHeight:44},"& .MuiAccordionSummary-content":{my:"10px"}};return o(a,e({sx:{width:820,flexShrink:0,display:"flex",flexDirection:"column",overflow:"hidden",borderRight:"1px solid #e5e7eb"}},{children:[o(a,e({sx:{px:2.5,py:2,borderBottom:"1px solid #e5e7eb"}},{children:[o(c,e({direction:"row",alignItems:"center",justifyContent:"space-between"},{children:[o(c,e({direction:"row",alignItems:"center",gap:1,sx:{flex:1,minWidth:0}},{children:[t(p,e({title:"Functional Prompt Block",placement:"top"},{children:t(h,{label:"FPB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:11,height:22,borderRadius:1}})})),we?t(g,{value:Ce,onChange:function(e){return _e(e.target.value)},size:"small",fullWidth:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:15,fontWeight:700,py:.5}}}):t(u,e({sx:{fontWeight:700,fontSize:15,color:"#111827"}},{children:(null==W?void 0:W.title)||"—"}))]})),we?o(c,e({direction:"row",gap:.5},{children:[t(s,e({size:"small",sx:{color:"#6b7280"},onClick:function(){return Se(!1)}},{children:t(_,{sx:{fontSize:16}})})),t(s,e({size:"small",sx:{color:"#16a34a"},onClick:function(){T(e(e({},W),{title:Ce,short_description:Ie,members:Ae,when_to_apply:Le,when_not_to_apply:Te})),Se(!1)}},{children:t(B,{sx:{fontSize:16}})}))]})):!D&&M&&t(s,e({size:"small",sx:{color:"#6b7280"},onClick:function(){_e((null==W?void 0:W.title)||""),We((null==W?void 0:W.short_description)||""),Be((null==W?void 0:W.members)||[]),De(Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:[]),Ve(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:(null==W?void 0:W.when_not_to_apply)?[W.when_not_to_apply]:[]),Se(!0)}},{children:t(C,{sx:{fontSize:16}})}))]})),we&&t(u,e({sx:{fontSize:11,color:"#5928ed",mt:.5}},{children:"Editing — changes won't be saved until you confirm"})),we?t(g,{value:Ie,onChange:function(e){return We(e.target.value)},size:"small",fullWidth:!0,multiline:!0,minRows:3,sx:{mt:1.5,"& .MuiOutlinedInput-input":{fontSize:12}}}):t(P,{description:(null==W?void 0:W.short_description)||"—"}),o(a,e({sx:{mt:1.5,border:"0.5px solid #d1d5db",borderRadius:"8px",display:"flex",overflow:"hidden"}},{children:[t(a,e({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #d1d5db",p:.5}},{children:o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:10,color:"#87898d"}},{children:"Total APBs :"})),t(u,e({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(l=null==W?void 0:W.members)||void 0===l?void 0:l.length)||0}))]}))})),t(a,e({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",p:.5}},{children:o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:10,color:"#87898d"}},{children:"Total Lines :"})),t(u,e({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(d=null==W?void 0:W.members)||void 0===d?void 0:d.reduce(function(e,n){var o,t;return e+((null!==(o=n.end_line)&&void 0!==o?o:0)-(null!==(t=n.start_line)&&void 0!==t?t:0)+1)},0))||0}))]}))}))]}))]})),o(a,e({sx:{flex:1,overflow:"auto",px:2,py:2,"&::-webkit-scrollbar":{width:4},"&::-webkit-scrollbar-thumb":{bgcolor:"#e5e7eb",borderRadius:2}}},{children:[o(m,e({expanded:q,onChange:function(){return J(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Categories"}))})),t(b,e({sx:{pt:0,px:2,pb:2}},{children:o(c,e({gap:1.5},{children:[o(a,{children:[t(u,e({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Category"})),we?t(v,e({fullWidth:!0,size:"small",value:G,onChange:function(e){Z(e.target.value),U("")},sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:O.map(function(n){return t(y,e({value:n.category_id},{children:n.category_name}),n.category_id)})})):t(g,{fullWidth:!0,size:"small",value:(null===(k=O.find(function(e){return e.category_id===G}))||void 0===k?void 0:k.category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]}),o(a,{children:[t(u,e({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Sub-Category"})),we?t(v,e({fullWidth:!0,size:"small",value:H,onChange:function(e){return U(e.target.value)},disabled:!G,sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:N.filter(function(e){return e.category_id===G}).map(function(n){return t(y,e({value:n.sub_category_id},{children:n.sub_category_name}),n.sub_category_id)})})):t(g,{fullWidth:!0,size:"small",value:(null===(I=N.find(function(e){return e.sub_category_id===H}))||void 0===I?void 0:I.sub_category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]})]}))}))]})),o(m,e({expanded:Q,onChange:function(){return X(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Atomic Prompt Blocks (APBs)"}))})),o(b,e({sx:{pt:0,px:1,pb:2}},{children:[t(c,e({gap:1},{children:(we?Ae:(null==W?void 0:W.members)||[]).map(function(n,i){return o(a,e({sx:{px:2,py:1,borderRadius:2,bgcolor:"#fff"}},{children:[o(a,e({sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:1,gap:1}},{children:[o(u,e({sx:{fontSize:14,fontWeight:500,color:"#111827"}},{children:[i+1,". ",n.section_name]})),we?t(s,e({size:"small",onClick:function(){return Be(function(e){return e.filter(function(e,n){return n!==i})})},sx:{color:"#dc2626",flexShrink:0}},{children:t(L,{sx:{fontSize:16}})})):t(a,e({onClick:function(){return V(n.section_name.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join("_"))},sx:{fontSize:14,color:"#475569",cursor:"pointer",flexShrink:0}},{children:"↗"}))]})),t(u,e({sx:{fontSize:12,lineHeight:1.5,color:"#64748b"}},{children:n.reason_for_inclusion})),A&&(r=n.segments||[],0===r.length?null:t(a,e({sx:{mt:1}},{children:t(a,e({sx:{display:"flex",flexWrap:"wrap",gap:1}},{children:r.map(function(e,n){return t(h,{clickable:!0,onClick:function(){return E(e.segmentized_text)},label:e.segmentized_text,sx:{borderRadius:1,bgcolor:"#eff6ff",color:"#3b82f6",border:"1px dashed #bfdbfe"}},n)})}))}))),t(w,{sx:{mt:2}})]}),i);var r})})),we&&o(a,e({onClick:function(){Ge(""),Ue(""),Pe(!0)},sx:{mt:1,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:1,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:13,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:16}})," Add APB"]}))]}))]})),o(m,e({expanded:ee,onChange:function(){return ne(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:o(u,e({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Applicability ",t("span",e({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• When to apply / When not to apply"}))]}))})),o(b,e({sx:{pt:0,px:1.5,pb:1.5}},{children:[o(m,e({expanded:te,onChange:function(){return ie(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:1,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 8px 0"}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When to Apply this FPB"}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:o(c,e({gap:.75},{children:[(we?Le:Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:["— Not yet available"]).map(function(n,i){return we?t(j,{value:n,onChange:function(e){return De(function(n){return n.map(function(n,o){return o===i?e:n})})},onDelete:function(){return De(function(e){return e.filter(function(e,n){return n!==i})})}},i):o(c,e({direction:"row",gap:1,alignItems:"flex-start"},{children:[o(u,e({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[i+1,"."]})),t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:n}))]}),i)}),we&&o(a,e({onClick:function(){return De(function(e){return n(n([],e,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:15}})," Add When to Apply"]}))]}))}))]})),o(m,e({expanded:le,onChange:function(){return de(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important","&:before":{display:"none"}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When NOT to Apply this FPB"}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:we?o(c,e({gap:.75},{children:[Te.map(function(e,n){return t(j,{value:e,onChange:function(e){return Ve(function(o){return o.map(function(o,t){return t===n?e:o})})},onDelete:function(){return Ve(function(e){return e.filter(function(e,o){return o!==n})})}},n)}),o(a,e({onClick:function(){return Ve(function(e){return n(n([],e,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:15}})," Add When NOT to Apply"]}))]})):Array.isArray(null==W?void 0:W.when_not_to_apply)||(null==W?void 0:W.when_not_to_apply)?t(c,e({gap:.75},{children:(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:[W.when_not_to_apply]).map(function(n,i){return o(c,e({direction:"row",gap:1,alignItems:"flex-start"},{children:[o(u,e({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[i+1,"."]})),t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:n}))]}),i)})})):t(u,e({sx:{fontSize:12.5,color:"#9ca3af",fontStyle:"italic"}},{children:"No conditions defined yet."}))}))]}))]}))]})),o(m,e({expanded:ce,onChange:function(){return se(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:o(u,e({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Specifications ",t("span",e({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• Strict Rules / Input / Output"}))]}))})),t(b,e({sx:{pt:0,px:1.5,pb:1.5}},{children:[{label:"Guidelines",expanded:fe,setExpanded:pe,content:null==W?void 0:W.additional_guidelines},{label:"Input",expanded:ge,setExpanded:me,content:null},{label:"Output",expanded:be,setExpanded:ve,content:null}].map(function(n,i){var r=n.label,l=n.expanded,d=n.setExpanded,a=n.content;return o(m,e({expanded:l,onChange:function(){return d(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:i<2?1:0,"&:before":{display:"none"},"&.Mui-expanded":{margin:i<2?"0 0 8px 0":0}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:o(c,e({direction:"row",alignItems:"center",gap:.5},{children:[t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:r})),"Guidelines"!==r&&t(R,{sx:{fontSize:13,color:"#9ca3af"}})]}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:t(u,e({sx:{fontSize:12.5,color:a?"#374151":"#9ca3af",fontStyle:a?"normal":"italic"}},{children:a||"No ".concat(r.toLowerCase()," defined yet.")}))}))]}),r)})}))]}))]})),o(S,e({open:Oe,onClose:function(){return Pe(!1)},maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:"12px"}}},{children:[o(a,e({sx:{px:3,py:2,display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e5e7eb"}},{children:[t(u,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Add new APB"})),t(s,e({size:"small",onClick:function(){return Pe(!1)}},{children:t(_,{sx:{fontSize:"1.1rem",color:"#6b7280"}})}))]})),o(a,e({sx:{px:3,py:2.5,display:"flex",flexDirection:"column",gap:2}},{children:[o(a,{children:[t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Title"})),t(g,{fullWidth:!0,size:"small",placeholder:"Specify the title of APB",value:Ne,onChange:function(e){return Ge(e.target.value)}})]}),o(a,{children:[t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Description"})),t(g,{fullWidth:!0,size:"small",multiline:!0,minRows:3,placeholder:"Describe the APB",value:Ze,onChange:function(e){return Ue(e.target.value)}})]})]})),o(a,e({sx:{px:3,py:2,display:"flex",justifyContent:"flex-end",gap:1,borderTop:"1px solid #e5e7eb"}},{children:[t(f,e({variant:"outlined",onClick:function(){return Pe(!1)},sx:{textTransform:"none",borderColor:"#d1d5db",color:"#374151"}},{children:"Cancel"})),t(f,e({variant:"contained",onClick:function(){Be(function(e){return n(n([],e,!0),[{section_name:Ne,reason_for_inclusion:Ze,content:""}],!1)}),Pe(!1)},sx:{textTransform:"none",bgcolor:"#5928ed","&:hover":{bgcolor:"#4c1d95"}}},{children:"Save"}))]}))]}))]}))},Z=function(n){var i,l,d,p,h,g=n.block,m=n.onBlockUpdate,x=n.isExtracting,b=n.isExtracted,v=n.onExtractSegments,y=n.isSaving,w=n.isSaved,S=n.onSave,z=n.onBack,C=n.title,R=void 0===C?"FPB Promptemon":C,B=n.categories,F=n.subCategories,L=n.selectedCategoryId,D=n.selectedSubCategoryId,M=n.onCategoryChange,T=n.onSubCategoryChange,V=n.showEditMode,E=void 0===V||V,O=n.showExtractSegments,P=void 0===O||O,j=r(1),Z=j[0],U=j[1],Y=r(!0),q=Y[0],J=Y[1],K=r(""),Q=K[0],X=K[1],$=r(""),ee=$[0],ne=$[1],oe=(null===(i=null==g?void 0:g.members)||void 0===i?void 0:i.map(function(e){if(!b||!e.segments||0===e.segments.length)return e.content||"";var n=e.content||"";return e.segments.forEach(function(e){e.raw_text&&e.segmentized_text&&(n=n.split(e.raw_text).join(e.segmentized_text))}),n}).join("\n\n"))||"";return o(a,e({sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",bgcolor:"#fff",overflow:"hidden"}},{children:[o(a,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0}},{children:[o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(s,e({size:"small",sx:{color:"#6b7280"},onClick:z},{children:t(k,{sx:{fontSize:18}})})),t(u,e({sx:{fontSize:14,fontWeight:600,color:"#111827"}},{children:R}))]})),o(a,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[t(f,e({variant:"contained",size:"small",disabled:!b||y||w,onClick:S,sx:{textTransform:"none",fontSize:"0.78rem",fontWeight:600,bgcolor:"#5928ed",px:2,py:.6,"&:hover":{bgcolor:"#4c1d95"},"&.Mui-disabled":{bgcolor:"#5928ed",color:"#fff",opacity:.4}}},{children:y?"Saving...":w?"Saved ✓":"Save FPB"})),t(s,e({size:"small",sx:{color:"#6b7280"},onClick:z},{children:t(_,{sx:{fontSize:18}})}))]}))]})),o(a,e({sx:{display:"flex",flex:1,overflow:"hidden"}},{children:[t(H,{block:g,isExtracted:b,isSaved:w,showEditMode:E,onBlockUpdate:m,onTagSelect:function(e){X(""),setTimeout(function(){return X(e)},50)},onVariableSelect:function(e){ne(""),setTimeout(function(){return ne(e)},50)},categories:B,subCategories:F,selectedCategoryId:L,selectedSubCategoryId:D,onCategoryChange:M,onSubCategoryChange:T}),o(a,e({sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5}},{children:[o(a,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[o(c,e({direction:"row",alignItems:"center",gap:1},{children:[o(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:[(null==g?void 0:g.title)||"—"," APBs"]})),o(c,e({direction:"row",alignItems:"center",gap:.5},{children:[t(s,e({size:"small",onClick:function(){return U(function(e){return Math.max(1,e-1)})},disabled:1===Z,sx:{color:"#6b7280",p:.4}},{children:t(I,{sx:{fontSize:16}})})),o(u,e({sx:{fontSize:12.5,color:"#6b7280"}},{children:[Z," of ",(null===(l=null==g?void 0:g.members)||void 0===l?void 0:l.length)||0]})),t(s,e({size:"small",onClick:function(){return U(function(e){var n;return Math.min((null===(n=null==g?void 0:g.members)||void 0===n?void 0:n.length)||0,e+1)})},disabled:Z===((null===(d=null==g?void 0:g.members)||void 0===d?void 0:d.length)||0),sx:{color:"#6b7280",p:.4}},{children:t(W,{sx:{fontSize:16}})}))]}))]})),t(c,e({direction:"row",alignItems:"center",gap:1.5},{children:P&&(b?o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:12.5,color:"#6b7280"}},{children:"Show Segments"})),t(a,e({sx:{width:36,height:20,borderRadius:"10px",bgcolor:"#7c3aed",display:"flex",alignItems:"center",px:.3,cursor:"pointer"}},{children:t(a,{sx:{width:14,height:14,borderRadius:"50%",bgcolor:"#fff",ml:"auto"}})}))]})):o(a,e({onClick:v,sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.85,borderRadius:1.5,bgcolor:"#7c3aed",cursor:x?"default":"pointer","&:hover":{bgcolor:"#6d28d9"},userSelect:"none",opacity:x?.7:1}},{children:[t(A,{sx:{fontSize:15,color:"#fff"}}),t(u,e({sx:{fontSize:13,fontWeight:600,color:"#fff"}},{children:x?"Extracting...":"Extract Segments"}))]})))}))]})),o(a,e({sx:{flex:1,minHeight:0,position:"relative"}},{children:[x&&t(a,e({sx:{position:"absolute",top:0,left:0,right:0,bottom:0,bgcolor:"rgba(0,0,0,0.6)",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:1}},{children:t(u,e({sx:{color:"#fff",fontSize:14,fontWeight:600}},{children:"Extracting segments..."}))})),o(a,e({sx:{border:"1px solid #30363d",borderRadius:1,overflow:"hidden",height:"100%"}},{children:[o(a,e({sx:{px:2,py:1,borderBottom:"1px solid #30363d",display:"flex",alignItems:"center",gap:1,bgcolor:"#161b22",flexShrink:0}},{children:[t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#ff5f57"}}),t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#febc2e"}}),t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#28c840"}}),o(u,e({sx:{ml:1,fontSize:11,color:"#8b949e",fontFamily:"monospace"}},{children:[(null===(h=null===(p=null==g?void 0:g.members)||void 0===p?void 0:p[Z-1])||void 0===h?void 0:h.section_name)||"—",".xml"]})),t(a,{sx:{flex:1}}),t(N,{isDarkMode:q,onChange:J})]})),t(G,{content:oe,selectedTag:Q,highlightVariable:ee,isDarkMode:q,height:"100%",fontSize:14})]}))]}))]}))]}))]}))};export{Z as default};
|
|
2
|
+
//# sourceMappingURL=PromptemonViewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptemonViewer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{default as FaqCitation}from"./features/CognitiveDecisioning/FaqCitation/FaqCitation.js";export{default as ImageCitationContent}from"./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js";export{default as VideoCitationContent}from"./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js";export{default as FileCitationContent}from"./features/RequirementAiCitations/FileCitation/FileCitationContent.js";export{default as WebCitationWithImageContent}from"./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";export{default as MarkdownWithImageCitation}from"./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js";export{default as AiReasoningCitation}from"./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js";export{default as TableCitationContent}from"./features/TableCitation/TableCitationContent.js";export{default as CitationsViewer}from"./features/CitationViewer/CitationsViewer.js";export{default as ExcelCitation}from"./features/ExcelCitation/ExcelCitations.js";export{default as ScannedDocCitation}from"./features/ScannedDocCitation/ScannedDocCitation.js";export{default as ChatDrawer}from"./features/ChatDrawer/ChatDrawer.js";export{FILE_INGESTION_STATUS,SUMMARY_EXPAND_HEIGHT_NUDGE,TRUNCATE_THRESHOLD}from"./features/ChatDrawer/constants/ChatDrawer.js";export{default as SplitterCitationsComponent}from"./features/SplitterCitations/SplitterCitationsComponent.js";export{SourcesBQCitation,findSourceCitation,parseSourcesBQHref}from"./features/DualCitation/SourceBQDataCompnent.js";export{default as CognitiveCompare}from"./features/CognitiveCompare/CognitiveCompare.js";export{default as CognitiveInternalgptCoreComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";export{default as TextualGuideLinesComponent}from"./features/TextualGuidelines/TextualGuideLinesComponent.js";export{default as RuleBookCitationWrapper}from"./features/RulebookCitations/RuleBookCitationWrapper.js";export{IngestionStatusChip,IngestionStatusComponent}from"./features/IngestionStatus/IngestionStatusComponent.js";export{ManageReminders}from"./features/ManageRemainders/ManageReminders.js";export{default as GptWebCitation}from"./features/GptWebCitation/GptWebCitation.js";export{useOnDemandCitationFetch}from"./hooks/useOnDemandCitationFetch.js";export{default as InstantLearningCitationWrapper}from"./features/InstantLearningCitation/InstantLearningCitationComponent.js";export{default as BPACitationRenderer}from"./features/BPACitationRenderer/BPACitationRenderer.js";export{extractLearnedFromUrl,extractRelevanceScoreFromContent,extractTopicFromContent,getWebCitationImageUrl,mapCitationDataToDisplay,resolveSkeletonVisitUrl,sanitizeExternalUrl}from"./features/GptWebCitation/utils/citationData.utils.js";export{CitationType,allowsGptCitationView,allowsWebCitationView,showsCitationViewToggle}from"./features/GptWebCitation/types.js";
|
|
1
|
+
export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{default as FaqCitation}from"./features/CognitiveDecisioning/FaqCitation/FaqCitation.js";export{default as ImageCitationContent}from"./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js";export{default as VideoCitationContent}from"./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js";export{default as FileCitationContent}from"./features/RequirementAiCitations/FileCitation/FileCitationContent.js";export{default as WebCitationWithImageContent}from"./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";export{default as MarkdownWithImageCitation}from"./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js";export{default as AiReasoningCitation}from"./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js";export{default as TableCitationContent}from"./features/TableCitation/TableCitationContent.js";export{default as CitationsViewer}from"./features/CitationViewer/CitationsViewer.js";export{default as ExcelCitation}from"./features/ExcelCitation/ExcelCitations.js";export{default as ScannedDocCitation}from"./features/ScannedDocCitation/ScannedDocCitation.js";export{default as ChatDrawer}from"./features/ChatDrawer/ChatDrawer.js";export{FILE_INGESTION_STATUS,SUMMARY_EXPAND_HEIGHT_NUDGE,TRUNCATE_THRESHOLD}from"./features/ChatDrawer/constants/ChatDrawer.js";export{default as SplitterCitationsComponent}from"./features/SplitterCitations/SplitterCitationsComponent.js";export{SourcesBQCitation,findSourceCitation,parseSourcesBQHref}from"./features/DualCitation/SourceBQDataCompnent.js";export{default as CognitiveCompare}from"./features/CognitiveCompare/CognitiveCompare.js";export{default as CognitiveInternalgptCoreComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";export{default as TextualGuideLinesComponent}from"./features/TextualGuidelines/TextualGuideLinesComponent.js";export{default as RuleBookCitationWrapper}from"./features/RulebookCitations/RuleBookCitationWrapper.js";export{IngestionStatusChip,IngestionStatusComponent}from"./features/IngestionStatus/IngestionStatusComponent.js";export{ManageReminders}from"./features/ManageRemainders/ManageReminders.js";export{default as PromptemonBlockViewer}from"./features/PromptemonBlockViewer/PromptemonBlockViewer.js";export{default as PromptemonViewer}from"./features/PromptemonViewer/PromptemonViewer.js";export{default as GptWebCitation}from"./features/GptWebCitation/GptWebCitation.js";export{useOnDemandCitationFetch}from"./hooks/useOnDemandCitationFetch.js";export{default as InstantLearningCitationWrapper}from"./features/InstantLearningCitation/InstantLearningCitationComponent.js";export{default as BPACitationRenderer}from"./features/BPACitationRenderer/BPACitationRenderer.js";export{extractLearnedFromUrl,extractRelevanceScoreFromContent,extractTopicFromContent,getWebCitationImageUrl,mapCitationDataToDisplay,resolveSkeletonVisitUrl,sanitizeExternalUrl}from"./features/GptWebCitation/utils/citationData.utils.js";export{CitationType,allowsGptCitationView,allowsWebCitationView,showsCitationViewToggle}from"./features/GptWebCitation/types.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptemonBlockViewerTest.d.ts","sourceRoot":"","sources":["../../../src/PromptemonBlockViewerTest.tsx"],"names":[],"mappings":"AAyBA,QAAA,MAAM,yBAAyB,+CAqC9B,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptemonViewerTest.d.ts","sourceRoot":"","sources":["../../../src/PromptemonViewerTest.tsx"],"names":[],"mappings":"AA+CA,QAAA,MAAM,oBAAoB,+CAiEzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface PromptemonBlockViewerProps {
|
|
2
|
+
title: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
content: string;
|
|
5
|
+
height?: number;
|
|
6
|
+
selectedTag?: string;
|
|
7
|
+
highlightVariable?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const PromptemonBlockViewer: ({ title, description, content, height, selectedTag, highlightVariable, }: PromptemonBlockViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default PromptemonBlockViewer;
|
|
11
|
+
//# sourceMappingURL=PromptemonBlockViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptemonBlockViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PromptemonBlockViewer/PromptemonBlockViewer.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,0BAA0B;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAwQD,QAAA,MAAM,qBAAqB,6EAOxB,0BAA0B,4CA6G5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/PromptemonBlockViewer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface SPBCategory {
|
|
2
|
+
category_id: string;
|
|
3
|
+
category_name: string;
|
|
4
|
+
description?: string | null;
|
|
5
|
+
}
|
|
6
|
+
export interface SPBSubCategory {
|
|
7
|
+
sub_category_id: string;
|
|
8
|
+
sub_category_name: string;
|
|
9
|
+
category_id: string;
|
|
10
|
+
description?: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface PromptemonViewerProps {
|
|
13
|
+
block: any;
|
|
14
|
+
onBlockUpdate: (updatedBlock: any) => void;
|
|
15
|
+
isExtracting: boolean;
|
|
16
|
+
isExtracted: boolean;
|
|
17
|
+
onExtractSegments: () => void;
|
|
18
|
+
isSaving: boolean;
|
|
19
|
+
isSaved: boolean;
|
|
20
|
+
onSave: () => void;
|
|
21
|
+
onBack: () => void;
|
|
22
|
+
title?: string;
|
|
23
|
+
categories: SPBCategory[];
|
|
24
|
+
subCategories: SPBSubCategory[];
|
|
25
|
+
selectedCategoryId: string;
|
|
26
|
+
selectedSubCategoryId: string;
|
|
27
|
+
onCategoryChange: (id: string) => void;
|
|
28
|
+
onSubCategoryChange: (id: string) => void;
|
|
29
|
+
onAddCategory?: (data: {
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
}) => Promise<void>;
|
|
33
|
+
onAddSubCategory?: (data: {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
categoryId: string;
|
|
37
|
+
}) => Promise<void>;
|
|
38
|
+
showEditMode?: boolean;
|
|
39
|
+
showExtractSegments?: boolean;
|
|
40
|
+
}
|
|
41
|
+
declare const PromptemonViewer: ({ block, onBlockUpdate, isExtracting, isExtracted, onExtractSegments, isSaving, isSaved, onSave, onBack, title, categories, subCategories, selectedCategoryId, selectedSubCategoryId, onCategoryChange, onSubCategoryChange, showEditMode, showExtractSegments, }: PromptemonViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export default PromptemonViewer;
|
|
43
|
+
//# sourceMappingURL=PromptemonViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptemonViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PromptemonViewer/PromptemonViewer.tsx"],"names":[],"mappings":"AA+EA,MAAM,WAAW,WAAW;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,cAAc;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IAElC,KAAK,EAAE,GAAG,CAAC;IACX,aAAa,EAAE,CAAC,YAAY,EAAE,GAAG,KAAK,IAAI,CAAC;IAG3C,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAG9B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;IAGnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,aAAa,EAAE,cAAc,EAAE,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtG,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAuoBD,QAAA,MAAM,gBAAgB,sQAmBnB,qBAAqB,4CA0IvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/PromptemonViewer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -35,6 +35,10 @@ export { default as RuleBookCitationWrapper } from "./features/RulebookCitations
|
|
|
35
35
|
export { IngestionStatusComponent } from "./features/IngestionStatus/IngestionStatusComponent";
|
|
36
36
|
export { IngestionStatusChip } from "./features/IngestionStatus/IngestionStatusComponent";
|
|
37
37
|
export { ManageReminders } from "./features/ManageRemainders/ManageReminders";
|
|
38
|
+
export { default as PromptemonBlockViewer } from "./features/PromptemonBlockViewer/PromptemonBlockViewer";
|
|
39
|
+
export type { PromptemonBlockViewerProps } from "./features/PromptemonBlockViewer/PromptemonBlockViewer";
|
|
40
|
+
export { default as PromptemonViewer } from "./features/PromptemonViewer/PromptemonViewer";
|
|
41
|
+
export type { PromptemonViewerProps, SPBCategory, SPBSubCategory } from "./features/PromptemonViewer/PromptemonViewer";
|
|
38
42
|
export { default as GptWebCitation } from "./features/GptWebCitation/GptWebCitation";
|
|
39
43
|
export { useOnDemandCitationFetch } from "./hooks/useOnDemandCitationFetch";
|
|
40
44
|
export { default as InstantLearningCitationWrapper } from "./features/InstantLearningCitation/InstantLearningCitationComponent";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-llm-studio/citation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.229",
|
|
4
4
|
"author": "Devesh Patel",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -176,6 +176,16 @@
|
|
|
176
176
|
"import": "./dist/features/BPACitationRenderer/BPACitationRenderer.js",
|
|
177
177
|
"require": "./dist/features/BPACitationRenderer/BPACitationRenderer.js",
|
|
178
178
|
"types": "./dist/types/src/features/BPACitationRenderer/BPACitationRenderer.d.ts"
|
|
179
|
+
},
|
|
180
|
+
"./PromptemonViewer": {
|
|
181
|
+
"import": "./dist/features/PromptemonViewer/PromptemonViewer.js",
|
|
182
|
+
"require": "./dist/cjs/features/PromptemonViewer/PromptemonViewer.js",
|
|
183
|
+
"types": "./dist/types/src/features/PromptemonViewer/PromptemonViewer.d.ts"
|
|
184
|
+
},
|
|
185
|
+
"./PromptemonBlockViewer": {
|
|
186
|
+
"import": "./dist/features/PromptemonBlockViewer/PromptemonBlockViewer.js",
|
|
187
|
+
"require": "./dist/cjs/features/PromptemonBlockViewer/PromptemonBlockViewer.js",
|
|
188
|
+
"types": "./dist/types/src/features/PromptemonBlockViewer/PromptemonBlockViewer.d.ts"
|
|
179
189
|
}
|
|
180
190
|
},
|
|
181
191
|
"repository": {
|