@epam/ai-dial-prompt-editor 0.0.0-stage → 1.3.0-dev.221

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.
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { PromptEditorProps } from '../../models/prompt-editor-props';
3
+ /** Form for authoring or editing a reusable prompt. */
4
+ export declare const PromptEditor: FC<PromptEditorProps>;
5
+ //# sourceMappingURL=PromptEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PromptEditor.d.ts","sourceRoot":"","sources":["../../../src/components/PromptEditor/PromptEditor.tsx"],"names":[],"mappings":"AAkCA,OAAO,0CAA0C,CAAC;AAClD,OAAO,0CAA0C,CAAC;AAClD,OAAO,EAGL,KAAK,EAAE,EAQR,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,kCAAkC,CAAC;AA2C1C,uDAAuD;AACvD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAka9C,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { PromptFolderFieldProps } from '../../models/prompt-folder-field-props';
3
+ /** Folder picker with inline create, rename, and delete controls. */
4
+ export declare const PromptFolderField: FC<PromptFolderFieldProps>;
5
+ //# sourceMappingURL=PromptFolderField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PromptFolderField.d.ts","sourceRoot":"","sources":["../../../src/components/PromptFolderField/PromptFolderField.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAgBrF,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAuQxD,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const PROMPT_EDITOR_CLASS: {
2
+ /** The editor's form column that holds Name, Description and Instructions. */
3
+ readonly form: "dial-prompt-editor-form";
4
+ /** The folder picker row rendered by `PromptFolderField`. */
5
+ readonly folderField: "dial-prompt-editor-folder-field";
6
+ };
7
+ //# sourceMappingURL=public-class-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB;IAC9B,8EAA8E;;IAE9E,6DAA6D;;CAErD,CAAC"}
package/index.css ADDED
@@ -0,0 +1,2 @@
1
+ @media (prefers-color-scheme:dark){.wmde-markdown,.wmde-markdown-var{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--color-prettylights-syntax-comment:#8b949e;--color-prettylights-syntax-constant:#79c0ff;--color-prettylights-syntax-entity:#d2a8ff;--color-prettylights-syntax-storage-modifier-import:#c9d1d9;--color-prettylights-syntax-entity-tag:#7ee787;--color-prettylights-syntax-keyword:#ff7b72;--color-prettylights-syntax-string:#a5d6ff;--color-prettylights-syntax-variable:#ffa657;--color-prettylights-syntax-brackethighlighter-unmatched:#f85149;--color-prettylights-syntax-invalid-illegal-text:#f0f6fc;--color-prettylights-syntax-invalid-illegal-bg:#8e1519;--color-prettylights-syntax-carriage-return-text:#f0f6fc;--color-prettylights-syntax-carriage-return-bg:#b62324;--color-prettylights-syntax-string-regexp:#7ee787;--color-prettylights-syntax-markup-list:#f2cc60;--color-prettylights-syntax-markup-heading:#1f6feb;--color-prettylights-syntax-markup-italic:#c9d1d9;--color-prettylights-syntax-markup-bold:#c9d1d9;--color-prettylights-syntax-markup-deleted-text:#ffdcd7;--color-prettylights-syntax-markup-deleted-bg:#67060c;--color-prettylights-syntax-markup-inserted-text:#aff5b4;--color-prettylights-syntax-markup-inserted-bg:#033a16;--color-prettylights-syntax-markup-changed-text:#ffdfb6;--color-prettylights-syntax-markup-changed-bg:#5a1e02;--color-prettylights-syntax-markup-ignored-text:#c9d1d9;--color-prettylights-syntax-markup-ignored-bg:#1158c7;--color-prettylights-syntax-meta-diff-range:#d2a8ff;--color-prettylights-syntax-brackethighlighter-angle:#8b949e;--color-prettylights-syntax-sublimelinter-gutter-mark:#484f58;--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;--color-fg-default:#c9d1d9;--color-fg-muted:#8b949e;--color-fg-subtle:#484f58;--color-canvas-default:#0d1117;--color-canvas-subtle:#161b22;--color-border-default:#30363d;--color-border-muted:#21262d;--color-neutral-muted:#6e768166;--color-accent-fg:#58a6ff;--color-accent-emphasis:#1f6feb;--color-attention-subtle:#bb800926;--color-danger-fg:#f85149;--color-danger-emphasis:#da3633;--color-attention-fg:#d29922;--color-attention-emphasis:#9e6a03;--color-done-fg:#a371f7;--color-done-emphasis:#8957e5;--color-success-fg:#3fb950;--color-success-emphasis:#238636;--color-copied-active-bg:#2e9b33}}@media (prefers-color-scheme:light){.wmde-markdown,.wmde-markdown-var{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--color-prettylights-syntax-comment:#6e7781;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-entity:#8250df;--color-prettylights-syntax-storage-modifier-import:#24292f;--color-prettylights-syntax-entity-tag:#116329;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#24292f;--color-prettylights-syntax-markup-bold:#24292f;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#eaeef2;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-brackethighlighter-angle:#57606a;--color-prettylights-syntax-sublimelinter-gutter-mark:#8c959f;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-fg-default:#24292f;--color-fg-muted:#57606a;--color-fg-subtle:#6e7781;--color-canvas-default:#fff;--color-canvas-subtle:#f6f8fa;--color-border-default:#d0d7de;--color-border-muted:#d8dee4;--color-neutral-muted:#afb8c133;--color-accent-fg:#0969da;--color-accent-emphasis:#0969da;--color-attention-subtle:#fff8c5;--color-danger-fg:#d1242f;--color-danger-emphasis:#cf222e;--color-attention-fg:#9a6700;--color-attention-emphasis:#9a6700;--color-done-fg:#8250df;--color-done-emphasis:#8250df;--color-success-fg:#1a7f37;--color-success-emphasis:#1f883d;--color-copied-active-bg:#2e9b33}}[data-color-mode*=dark] .wmde-markdown,[data-color-mode*=dark] .wmde-markdown-var,.wmde-markdown-var[data-color-mode*=dark],.wmde-markdown[data-color-mode*=dark],body[data-color-mode*=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--color-prettylights-syntax-comment:#8b949e;--color-prettylights-syntax-constant:#79c0ff;--color-prettylights-syntax-entity:#d2a8ff;--color-prettylights-syntax-storage-modifier-import:#c9d1d9;--color-prettylights-syntax-entity-tag:#7ee787;--color-prettylights-syntax-keyword:#ff7b72;--color-prettylights-syntax-string:#a5d6ff;--color-prettylights-syntax-variable:#ffa657;--color-prettylights-syntax-brackethighlighter-unmatched:#f85149;--color-prettylights-syntax-invalid-illegal-text:#f0f6fc;--color-prettylights-syntax-invalid-illegal-bg:#8e1519;--color-prettylights-syntax-carriage-return-text:#f0f6fc;--color-prettylights-syntax-carriage-return-bg:#b62324;--color-prettylights-syntax-string-regexp:#7ee787;--color-prettylights-syntax-markup-list:#f2cc60;--color-prettylights-syntax-markup-heading:#1f6feb;--color-prettylights-syntax-markup-italic:#c9d1d9;--color-prettylights-syntax-markup-bold:#c9d1d9;--color-prettylights-syntax-markup-deleted-text:#ffdcd7;--color-prettylights-syntax-markup-deleted-bg:#67060c;--color-prettylights-syntax-markup-inserted-text:#aff5b4;--color-prettylights-syntax-markup-inserted-bg:#033a16;--color-prettylights-syntax-markup-changed-text:#ffdfb6;--color-prettylights-syntax-markup-changed-bg:#5a1e02;--color-prettylights-syntax-markup-ignored-text:#c9d1d9;--color-prettylights-syntax-markup-ignored-bg:#1158c7;--color-prettylights-syntax-meta-diff-range:#d2a8ff;--color-prettylights-syntax-brackethighlighter-angle:#8b949e;--color-prettylights-syntax-sublimelinter-gutter-mark:#484f58;--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;--color-fg-default:#c9d1d9;--color-fg-muted:#8b949e;--color-fg-subtle:#484f58;--color-canvas-default:#0d1117;--color-canvas-subtle:#161b22;--color-border-default:#30363d;--color-border-muted:#21262d;--color-neutral-muted:#6e768166;--color-accent-fg:#58a6ff;--color-accent-emphasis:#1f6feb;--color-attention-subtle:#bb800926;--color-danger-fg:#f85149}[data-color-mode*=light] .wmde-markdown,[data-color-mode*=light] .wmde-markdown-var,.wmde-markdown-var[data-color-mode*=light],.wmde-markdown[data-color-mode*=light],body[data-color-mode*=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--color-prettylights-syntax-comment:#6e7781;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-entity:#8250df;--color-prettylights-syntax-storage-modifier-import:#24292f;--color-prettylights-syntax-entity-tag:#116329;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#24292f;--color-prettylights-syntax-markup-bold:#24292f;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#eaeef2;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-brackethighlighter-angle:#57606a;--color-prettylights-syntax-sublimelinter-gutter-mark:#8c959f;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-fg-default:#24292f;--color-fg-muted:#57606a;--color-fg-subtle:#6e7781;--color-canvas-default:#fff;--color-canvas-subtle:#f6f8fa;--color-border-default:#d0d7de;--color-border-muted:#d8dee4;--color-neutral-muted:#afb8c133;--color-accent-fg:#0969da;--color-accent-emphasis:#0969da;--color-attention-subtle:#fff8c5;--color-danger-fg:#cf222e}.wmde-markdown{-webkit-text-size-adjust:100%;word-wrap:break-word;color:var(--color-fg-default);background-color:var(--color-canvas-default);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;font-size:16px;line-height:1.5}.wmde-markdown details,.wmde-markdown figcaption,.wmde-markdown figure{display:block}.wmde-markdown summary{display:list-item}.wmde-markdown [hidden]{display:none!important}.wmde-markdown a{color:var(--color-accent-fg);background-color:#0000;text-decoration:none}.wmde-markdown a:active,.wmde-markdown a:hover{outline-width:0}.wmde-markdown abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.wmde-markdown b,.wmde-markdown strong{font-weight:600}.wmde-markdown dfn{font-style:italic}.wmde-markdown h1{border-bottom:1px solid var(--color-border-muted);margin:.67em 0;padding-bottom:.3em;font-size:2em;font-weight:600}.wmde-markdown mark{background-color:var(--color-attention-subtle);color:var(--color-text-primary)}.wmde-markdown small{font-size:90%}.wmde-markdown sub,.wmde-markdown sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}.wmde-markdown sub{bottom:-.25em}.wmde-markdown sup{top:-.5em}.wmde-markdown img{box-sizing:content-box;background-color:var(--color-canvas-default);border-style:none;max-width:100%;display:inline-block}.wmde-markdown code,.wmde-markdown kbd,.wmde-markdown pre,.wmde-markdown samp{font-family:monospace;font-size:1em}.wmde-markdown figure{margin:1em 40px}.wmde-markdown hr{box-sizing:content-box;border:0;border-bottom:1px solid var(--color-border-muted);background:0 0;background-color:var(--color-border-default);height:.25em;margin:24px 0;padding:0;overflow:hidden}.wmde-markdown input{font:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible}.wmde-markdown [type=button],.wmde-markdown [type=reset],.wmde-markdown [type=submit]{-webkit-appearance:button}.wmde-markdown [type=button]::-moz-focus-inner{border-style:none;padding:0}.wmde-markdown [type=reset]::-moz-focus-inner{border-style:none;padding:0}.wmde-markdown [type=submit]::-moz-focus-inner{border-style:none;padding:0}:is(.wmde-markdown [type=button]:-moz-focusring,.wmde-markdown [type=reset]:-moz-focusring,.wmde-markdown [type=submit]:-moz-focusring){outline:1px dotted buttontext}.wmde-markdown [type=checkbox],.wmde-markdown [type=radio]{box-sizing:border-box;padding:0}.wmde-markdown [type=number]::-webkit-inner-spin-button{height:auto}.wmde-markdown [type=number]::-webkit-outer-spin-button{height:auto}.wmde-markdown [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.wmde-markdown [type=search]::-webkit-search-cancel-button{-webkit-appearance:none}.wmde-markdown [type=search]::-webkit-search-decoration{-webkit-appearance:none}.wmde-markdown ::-webkit-input-placeholder{color:inherit;opacity:.54}.wmde-markdown ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.wmde-markdown a:hover{text-decoration:underline}.wmde-markdown hr:before{content:"";display:table}.wmde-markdown hr:after{clear:both;content:"";display:table}.wmde-markdown table{border-spacing:0;border-collapse:collapse;width:max-content;max-width:100%;display:block}.wmde-markdown td,.wmde-markdown th{padding:0}.wmde-markdown details summary{cursor:pointer}.wmde-markdown details:not([open])>:not(summary){display:none!important}.wmde-markdown kbd{color:var(--color-fg-default);vertical-align:middle;background-color:var(--color-canvas-subtle);border:solid 1px var(--color-neutral-muted);border-bottom-color:var(--color-neutral-muted);box-shadow:inset 0 -1px 0 var(--color-neutral-muted);border-radius:6px;padding:3px 5px;font:11px/10px ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;display:inline-block}.wmde-markdown h1,.wmde-markdown h2,.wmde-markdown h3,.wmde-markdown h4,.wmde-markdown h5,.wmde-markdown h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.wmde-markdown h2{border-bottom:1px solid var(--color-border-muted);padding-bottom:.3em;font-size:1.5em;font-weight:600}.wmde-markdown h3{font-size:1.25em;font-weight:600}.wmde-markdown h4{font-size:1em;font-weight:600}.wmde-markdown h5{font-size:.875em;font-weight:600}.wmde-markdown h6{color:var(--color-fg-muted);font-size:.85em;font-weight:600}.wmde-markdown p{margin-top:0;margin-bottom:10px}.wmde-markdown blockquote{color:var(--color-fg-muted);border-left:.25em solid var(--color-border-default);margin:0;padding:0 1em}.wmde-markdown ul,.wmde-markdown ol{margin-top:0;margin-bottom:0;padding-left:2em}.wmde-markdown ol ol,.wmde-markdown ul ol{list-style-type:lower-roman}.wmde-markdown ul ul ol,.wmde-markdown ul ol ol,.wmde-markdown ol ul ol,.wmde-markdown ol ol ol{list-style-type:lower-alpha}.wmde-markdown dd{margin-left:0}.wmde-markdown tt,.wmde-markdown code{font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px}.wmde-markdown pre{word-wrap:normal;margin-top:0;margin-bottom:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px}.wmde-markdown .octicon{vertical-align:text-bottom;fill:currentColor;display:inline-block;overflow:visible!important}.wmde-markdown ::placeholder{color:var(--color-fg-subtle);opacity:1}.wmde-markdown input::-webkit-outer-spin-button{appearance:none;margin:0}.wmde-markdown input::-webkit-inner-spin-button{appearance:none;margin:0}.wmde-markdown [data-catalyst]{display:block}.wmde-markdown:before{content:"";display:table}.wmde-markdown:after{clear:both;content:"";display:table}.wmde-markdown>:first-child{margin-top:0!important}.wmde-markdown>:last-child{margin-bottom:0!important}.wmde-markdown a:not([href]){color:inherit;text-decoration:none}.wmde-markdown .absent{color:var(--color-danger-fg)}.wmde-markdown a.anchor{float:left;margin-left:-20px;padding-right:4px;line-height:1}.wmde-markdown .anchor:focus{outline:none}.wmde-markdown p,.wmde-markdown blockquote,.wmde-markdown ul,.wmde-markdown ol,.wmde-markdown dl,.wmde-markdown table,.wmde-markdown pre,.wmde-markdown details{margin-top:0;margin-bottom:16px}.wmde-markdown blockquote>:first-child{margin-top:0}.wmde-markdown blockquote>:last-child{margin-bottom:0}.wmde-markdown sup>a:before{content:"["}.wmde-markdown sup>a:after{content:"]"}.wmde-markdown h1 .octicon-link,.wmde-markdown h2 .octicon-link,.wmde-markdown h3 .octicon-link,.wmde-markdown h4 .octicon-link,.wmde-markdown h5 .octicon-link,.wmde-markdown h6 .octicon-link{color:var(--color-fg-default);vertical-align:middle;visibility:hidden}.wmde-markdown h1:hover .anchor,.wmde-markdown h2:hover .anchor,.wmde-markdown h3:hover .anchor,.wmde-markdown h4:hover .anchor,.wmde-markdown h5:hover .anchor,.wmde-markdown h6:hover .anchor{text-decoration:none}.wmde-markdown h1:hover .anchor .octicon-link,.wmde-markdown h2:hover .anchor .octicon-link,.wmde-markdown h3:hover .anchor .octicon-link,.wmde-markdown h4:hover .anchor .octicon-link,.wmde-markdown h5:hover .anchor .octicon-link,.wmde-markdown h6:hover .anchor .octicon-link{visibility:visible}.wmde-markdown h1 tt,.wmde-markdown h1 code,.wmde-markdown h2 tt,.wmde-markdown h2 code,.wmde-markdown h3 tt,.wmde-markdown h3 code,.wmde-markdown h4 tt,.wmde-markdown h4 code,.wmde-markdown h5 tt,.wmde-markdown h5 code,.wmde-markdown h6 tt,.wmde-markdown h6 code{font-size:inherit;padding:0 .2em}.wmde-markdown ul.no-list,.wmde-markdown ol.no-list{padding:0;list-style-type:none}.wmde-markdown ol[type="1"]{list-style-type:decimal}.wmde-markdown ol[type=a]{list-style-type:lower-alpha}.wmde-markdown ol[type=i]{list-style-type:lower-roman}.wmde-markdown div>ol:not([type]){list-style-type:decimal}.wmde-markdown ul ul,.wmde-markdown ul ol,.wmde-markdown ol ol,.wmde-markdown ol ul{margin-top:0;margin-bottom:0}.wmde-markdown li>p{margin-top:16px}.wmde-markdown li+li{margin-top:.25em}.wmde-markdown dl{padding:0}.wmde-markdown dl dt{margin-top:16px;padding:0;font-size:1em;font-style:italic;font-weight:600}.wmde-markdown dl dd{margin-bottom:16px;padding:0 16px}.wmde-markdown table th{font-weight:600}.wmde-markdown table th,.wmde-markdown table td{border:1px solid var(--color-border-default);padding:6px 13px}.wmde-markdown table tr{background-color:var(--color-canvas-default);border-top:1px solid var(--color-border-muted)}.wmde-markdown table tr:nth-child(2n){background-color:var(--color-canvas-subtle)}.wmde-markdown table img{background-color:#0000}.wmde-markdown img[align=right]{padding-left:20px}.wmde-markdown img[align=left]{padding-right:20px}.wmde-markdown .emoji{vertical-align:text-top;background-color:#0000;max-width:none}.wmde-markdown span.frame{display:block;overflow:hidden}.wmde-markdown span.frame>span{float:left;border:1px solid var(--color-border-default);width:auto;margin:13px 0 0;padding:7px;display:block;overflow:hidden}.wmde-markdown span.frame span img{float:left;display:block}.wmde-markdown span.frame span span{clear:both;color:var(--color-fg-default);padding:5px 0 0;display:block}.wmde-markdown span.align-center{clear:both;display:block;overflow:hidden}.wmde-markdown span.align-center>span{text-align:center;margin:13px auto 0;display:block;overflow:hidden}.wmde-markdown span.align-center span img{text-align:center;margin:0 auto}.wmde-markdown span.align-right{clear:both;display:block;overflow:hidden}.wmde-markdown span.align-right>span{text-align:right;margin:13px 0 0;display:block;overflow:hidden}.wmde-markdown span.align-right span img{text-align:right;margin:0}.wmde-markdown span.float-left{float:left;margin-right:13px;display:block;overflow:hidden}.wmde-markdown span.float-left span{margin:13px 0 0}.wmde-markdown span.float-right{float:right;margin-left:13px;display:block;overflow:hidden}.wmde-markdown span.float-right>span{text-align:right;margin:13px auto 0;display:block;overflow:hidden}.wmde-markdown code,.wmde-markdown tt{background-color:var(--color-neutral-muted);border-radius:6px;margin:0;padding:.2em .4em;font-size:85%}.wmde-markdown code br,.wmde-markdown tt br{display:none}.wmde-markdown del code{-webkit-text-decoration:inherit;text-decoration:inherit}.wmde-markdown pre code{font-size:100%}.wmde-markdown pre>code{word-break:normal;white-space:pre;background:0 0;border:0;margin:0;padding:0}.wmde-markdown pre{background-color:var(--color-canvas-subtle);border-radius:6px;font-size:85%;line-height:1.45}.wmde-markdown pre code,.wmde-markdown pre tt{max-width:auto;line-height:inherit;word-wrap:normal;background-color:#0000;border:0;margin:0;padding:0;display:inline;overflow:visible}.wmde-markdown pre>code{padding:16px;display:block;overflow:auto}.wmde-markdown pre>code::-webkit-scrollbar{background:0 0;width:8px;height:8px}.wmde-markdown pre>code::-webkit-scrollbar-thumb{background:var(--color-fg-muted);border-radius:10px}.wmde-markdown .csv-data td,.wmde-markdown .csv-data th{text-align:left;white-space:nowrap;padding:5px;font-size:12px;line-height:1;overflow:hidden}.wmde-markdown .csv-data .blob-num{text-align:right;background:var(--color-canvas-default);border:0;padding:10px 8px 9px}.wmde-markdown .csv-data tr{border-top:0}.wmde-markdown .csv-data th{background:var(--color-canvas-subtle);border-top:0;font-weight:600}.wmde-markdown .footnotes{color:var(--color-fg-muted);border-top:1px solid var(--color-border-default);font-size:12px}.wmde-markdown .footnotes ol{padding-left:16px}.wmde-markdown .footnotes li{position:relative}.wmde-markdown .footnotes li:target:before{pointer-events:none;content:"";border:2px solid var(--color-accent-emphasis);border-radius:6px;position:absolute;inset:-8px -8px -8px -24px}.wmde-markdown .footnotes li:target{color:var(--color-fg-default)}.wmde-markdown .footnotes .data-footnote-backref g-emoji{font-family:monospace}.wmde-markdown .task-list-item{list-style-type:none}.wmde-markdown .task-list-item label{font-weight:400}.wmde-markdown .task-list-item.enabled label{cursor:pointer}.wmde-markdown .task-list-item+.wmde-markdown .task-list-item{margin-top:3px}.wmde-markdown .task-list-item .handle{display:none}.wmde-markdown .task-list-item-checkbox,.wmde-markdown .contains-task-list input[type=checkbox]{vertical-align:middle;margin:0 .2em .25em -1.6em}.wmde-markdown .contains-task-list:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.wmde-markdown .contains-task-list:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) input[type=checkbox]{margin:0 -1.6em .25em .2em}.wmde-markdown ::-webkit-calendar-picker-indicator{filter:invert(50%)}.wmde-markdown pre{position:relative}.wmde-markdown pre .copied{visibility:hidden;cursor:pointer;color:var(--color-fg-default);background:var(--color-border-default);border-radius:5px;padding:6px;font-size:12px;transition:all .3s;display:flex;position:absolute;top:6px;right:6px}.wmde-markdown pre .copied .octicon-copy{display:block}.wmde-markdown pre .copied .octicon-check{display:none}.wmde-markdown pre:hover .copied{visibility:visible}.wmde-markdown pre:hover .copied:hover{background:var(--color-prettylights-syntax-entity-tag);color:var(--color-canvas-default)}.wmde-markdown pre:hover .copied:active,.wmde-markdown pre .copied.active{background:var(--color-copied-active-bg);color:var(--color-canvas-default)}.wmde-markdown pre .active .octicon-copy{display:none}.wmde-markdown pre .active .octicon-check{display:block}.wmde-markdown .markdown-alert{color:inherit;border-left:.25em solid var(--borderColor-default,var(--color-border-default));margin-bottom:16px;padding:.5rem 1em}.wmde-markdown .markdown-alert>:last-child{margin-bottom:0!important}.wmde-markdown .markdown-alert .markdown-alert-title{align-items:center;font-size:14px;font-weight:500;line-height:1;display:flex}.wmde-markdown .markdown-alert .markdown-alert-title svg.octicon{margin-right:var(--base-size-8,8px)!important}.wmde-markdown .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis,var(--color-accent-emphasis))}.wmde-markdown .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent,var(--color-accent-fg))}.wmde-markdown .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis,var(--color-success-emphasis))}.wmde-markdown .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success,var(--color-success-fg))}.wmde-markdown .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis,var(--color-done-emphasis))}.wmde-markdown .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done,var(--color-done-fg))}.wmde-markdown .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis,var(--color-attention-emphasis))}.wmde-markdown .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention,var(--color-attention-fg))}.wmde-markdown .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis,var(--color-danger-emphasis))}.wmde-markdown .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger,var(--color-danger-fg))}.wmde-markdown .highlight-line{background-color:var(--color-neutral-muted)}.wmde-markdown .code-line.line-number:before{text-align:right;width:1rem;color:var(--color-fg-subtle);content:attr(line);white-space:nowrap;margin-right:16px;display:inline-block}.wmde-markdown .token.comment,.wmde-markdown .token.prolog,.wmde-markdown .token.doctype,.wmde-markdown .token.cdata{color:var(--color-prettylights-syntax-comment)}.wmde-markdown .token.namespace{opacity:.7}.wmde-markdown .token.property,.wmde-markdown .token.tag,.wmde-markdown .token.selector,.wmde-markdown .token.constant,.wmde-markdown .token.symbol,.wmde-markdown .token.deleted{color:var(--color-prettylights-syntax-entity-tag)}.wmde-markdown .token.maybe-class-name{color:var(--color-prettylights-syntax-variable)}.wmde-markdown .token.property-access,.wmde-markdown .token.operator,.wmde-markdown .token.boolean,.wmde-markdown .token.number,.wmde-markdown .token.selector .token.class,.wmde-markdown .token.attr-name,.wmde-markdown .token.string,.wmde-markdown .token.char,.wmde-markdown .token.builtin{color:var(--color-prettylights-syntax-constant)}.wmde-markdown .token.deleted{color:var(--color-prettylights-syntax-markup-deleted-text)}.wmde-markdown .code-line .token.deleted{background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.wmde-markdown .token.inserted{color:var(--color-prettylights-syntax-markup-inserted-text)}.wmde-markdown .code-line .token.inserted{background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.wmde-markdown .token.variable{color:var(--color-prettylights-syntax-constant)}.wmde-markdown .token.entity,.wmde-markdown .token.url,.wmde-markdown .language-css .token.string,.wmde-markdown .style .token.string,.wmde-markdown .token.color,.wmde-markdown .token.atrule,.wmde-markdown .token.attr-value,.wmde-markdown .token.function,.wmde-markdown .token.class-name{color:var(--color-prettylights-syntax-string)}.wmde-markdown .token.rule,.wmde-markdown .token.regex,.wmde-markdown .token.important,.wmde-markdown .token.keyword{color:var(--color-prettylights-syntax-keyword)}.wmde-markdown .token.coord{color:var(--color-prettylights-syntax-meta-diff-range)}.wmde-markdown .token.important,.wmde-markdown .token.bold{font-weight:700}.wmde-markdown .token.italic{font-style:italic}.wmde-markdown .token.entity{cursor:help}.w-md-editor-bar{cursor:s-resize;z-index:3;-webkit-user-select:none;user-select:none;border-radius:0 0 3px;width:14px;height:10px;margin-top:-11px;margin-right:0;position:absolute;bottom:0;right:0}.w-md-editor-bar svg{margin:0 auto;display:block}.w-md-editor-area{border-radius:5px;overflow:auto}.w-md-editor-text{text-align:left;white-space:pre-wrap;word-break:keep-all;overflow-wrap:break-word;box-sizing:border-box;font-variant-ligatures:common-ligatures;min-height:100%;margin:0;padding:10px;position:relative;font-size:14px!important;line-height:18px!important}.w-md-editor-text-pre,.w-md-editor-text-input,.w-md-editor-text>.w-md-editor-text-pre{box-sizing:inherit;display:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-variant-ligatures:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;tab-size:inherit;text-indent:inherit;text-rendering:inherit;text-transform:inherit;white-space:inherit;overflow-wrap:inherit;word-break:inherit;word-break:normal;background:0 0;border:0;margin:0;padding:0;font-family:var(--md-editor-font-family)!important}.w-md-editor-text-pre{pointer-events:none;position:relative;background-color:#0000!important;margin:0!important}.w-md-editor-text-pre>code{font-family:var(--md-editor-font-family)!important;padding:0!important;font-size:14px!important;line-height:18px!important}.w-md-editor-text-input{resize:none;width:100%;height:100%;color:inherit;padding:inherit;-webkit-font-smoothing:antialiased;-webkit-text-fill-color:transparent;outline:0;position:absolute;top:0;left:0;overflow:hidden}.w-md-editor-text-input:empty{-webkit-text-fill-color:inherit!important}.w-md-editor-text-pre,.w-md-editor-text-input{word-wrap:pre;word-break:break-word;white-space:pre-wrap}@media (-ms-high-contrast:none),(-ms-high-contrast:active){.w-md-editor-text-input{color:#0000!important}.w-md-editor-text-input::selection{color:#0000!important;background-color:#accef7!important}}.w-md-editor-text-pre .punctuation{color:var(--color-prettylights-syntax-comment,#8b949e)!important}.w-md-editor-text-pre .token.url,.w-md-editor-text-pre .token.content{color:var(--color-prettylights-syntax-constant,#0550ae)!important}.w-md-editor-text-pre .token.title.important{color:var(--color-prettylights-syntax-markup-bold,#24292f)}.w-md-editor-text-pre .token.code-block .function{color:var(--color-prettylights-syntax-entity,#8250df)}.w-md-editor-text-pre .token.bold{font-weight:unset!important}.w-md-editor-text-pre .token.title{line-height:unset!important;font-size:unset!important;font-weight:unset!important}.w-md-editor-text-pre .token.code.keyword{color:var(--color-prettylights-syntax-constant,#0550ae)!important}.w-md-editor-text-pre .token.strike,.w-md-editor-text-pre .token.strike .content{color:var(--color-prettylights-syntax-markup-deleted-text,#82071e)!important}.w-md-editor-toolbar-child{box-shadow:0 0 0 1px var(--md-editor-box-shadow-color), 0 0 0 var(--md-editor-box-shadow-color), 0 1px 1px var(--md-editor-box-shadow-color);background-color:var(--md-editor-background-color);z-index:1;border-radius:3px;display:none;position:absolute}.w-md-editor-toolbar-child.active{display:block}.w-md-editor-toolbar-child .w-md-editor-toolbar{border-bottom:0;border-radius:3px;padding:3px}.w-md-editor-toolbar-child .w-md-editor-toolbar ul>li{display:block}.w-md-editor-toolbar-child .w-md-editor-toolbar ul>li button{width:-webkit-fill-available;height:initial;box-sizing:border-box;margin:0;padding:3px 4px 2px}.w-md-editor-toolbar{border-bottom:1px solid var(--md-editor-box-shadow-color);background-color:var(--md-editor-background-color);-webkit-user-select:none;user-select:none;border-radius:3px 3px 0 0;flex-wrap:wrap;justify-content:space-between;align-items:center;padding:3px;display:flex}.w-md-editor-toolbar.bottom{border-bottom:0;border-top:1px solid var(--md-editor-box-shadow-color);border-radius:0 0 3px 3px}.w-md-editor-toolbar ul,.w-md-editor-toolbar li{line-height:initial;margin:0;padding:0;list-style:none}.w-md-editor-toolbar li{font-size:14px;display:inline-block}.w-md-editor-toolbar li+li{margin:0}.w-md-editor-toolbar li>button{text-transform:none;cursor:pointer;white-space:nowrap;height:20px;color:var(--color-fg-default);background:0 0;border:none;border-radius:2px;outline:none;margin:0 1px;padding:4px;font-weight:400;line-height:14px;transition:all .3s;overflow:visible}.w-md-editor-toolbar li>button:hover,.w-md-editor-toolbar li>button:focus{background-color:var(--color-neutral-muted);color:var(--color-accent-fg)}.w-md-editor-toolbar li>button:active{background-color:var(--color-neutral-muted);color:var(--color-danger-fg)}.w-md-editor-toolbar li>button:disabled{color:var(--md-editor-box-shadow-color);cursor:not-allowed}.w-md-editor-toolbar li>button:disabled:hover{color:var(--md-editor-box-shadow-color);background-color:#0000}.w-md-editor-toolbar li.active>button{color:var(--color-accent-fg);background-color:var(--color-neutral-muted)}.w-md-editor-toolbar-divider{vertical-align:middle;background-color:var(--md-editor-box-shadow-color);width:1px;height:14px;margin:-3px 3px 0!important}.w-md-editor{text-align:left;color:var(--color-fg-default);--md-editor-font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;--md-editor-background-color:var(--color-canvas-default,#fff);--md-editor-box-shadow-color:var(--color-border-default,#d0d7de);box-shadow:0 0 0 1px var(--md-editor-box-shadow-color), 0 0 0 var(--md-editor-box-shadow-color), 0 1px 1px var(--md-editor-box-shadow-color);background-color:var(--md-editor-background-color);border-radius:3px;flex-direction:column;padding-bottom:1px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;display:flex;position:relative}.w-md-editor.w-md-editor-rtl{text-align:right!important;direction:rtl!important}.w-md-editor.w-md-editor-rtl .w-md-editor-preview{box-shadow:inset -1px 0 0 0 var(--md-editor-box-shadow-color);left:0;right:unset!important;text-align:right!important}.w-md-editor.w-md-editor-rtl .w-md-editor-text{text-align:right!important}.w-md-editor-toolbar{height:fit-content}.w-md-editor-content{border-radius:0 0 3px;height:100%;position:relative;overflow:auto}.w-md-editor .copied{display:none!important}.w-md-editor-input{width:50%;height:100%}.w-md-editor-text-pre>code{word-break:break-word!important;white-space:pre-wrap!important}.w-md-editor-preview{box-sizing:border-box;width:50%;box-shadow:inset 1px 0 0 0 var(--md-editor-box-shadow-color);border-radius:0 0 5px;flex-direction:column;padding:10px 20px;display:flex;position:absolute;top:0;bottom:0;right:0;overflow:auto}.w-md-editor-preview .anchor{display:none}.w-md-editor-preview .contains-task-list li.task-list-item{list-style:none}.w-md-editor-show-preview .w-md-editor-input{background-color:var(--md-editor-background-color);width:0%;overflow:hidden}.w-md-editor-show-preview .w-md-editor-preview{width:100%;box-shadow:inset 0 0}.w-md-editor-show-edit .w-md-editor-input{width:100%}.w-md-editor-show-edit .w-md-editor-preview{width:0%;padding:0}.w-md-editor-fullscreen{z-index:99999;position:fixed;inset:0;overflow:hidden;height:100%!important}.w-md-editor-fullscreen .w-md-editor-content{height:100%}._contentError_1qtel_1{color:var(--pe-content-error,var(--text-error,#ae2f2f))}._contentInvalid_1qtel_6 .dial-kit-markdown-editor .w-md-editor{border-color:var(--pe-content-invalid-border,var(--stroke-error,#ae2f2f))}
2
+ /*$vite$:1*/
package/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export { PromptEditor } from './components/PromptEditor/PromptEditor';
2
+ export { PromptFolderField } from './components/PromptFolderField/PromptFolderField';
3
+ export type { PromptEditorErrors, PromptEditorColors, PromptEditorFolder, PromptEditorLabels, PromptEditorProps, PromptEditorStyles, PromptEditorTypography, PromptEditorValues, PromptFolderActions, } from './models/prompt-editor-props';
4
+ export type { PromptFolderFieldProps } from './models/prompt-folder-field-props';
5
+ export { FolderFormMode } from './types/folder-form-mode';
6
+ export { PROMPT_EDITOR_CLASS } from './constants/public-class-names';
7
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC"}
package/index.js ADDED
@@ -0,0 +1,428 @@
1
+ import { DEFAULT_METADATA_FORM_LABELS as e, EntityEditor as t, MetadataField as n, MetadataForm as r } from "@epam/ai-dial-builder-form";
2
+ import { ConfirmationDialog as i, MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as a, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as o, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as s, TextRefinementField as c, buildCssVars as l, mergeClasses as u, useAvailableHeightCap as d, useTextRefinement as f, useUnsavedChangesGuard as p } from "@epam/ai-dial-chat-shared";
3
+ import { ConfirmationPopupVariant as ee, DIAL_ICON_SIZE as m, DIAL_KIT_ICON_STROKE as h, ElementSize as g, ErrorText as _, GhostIconButton as v, Input as y, Label as b, NeutralButton as x, Select as S, Spinner as C } from "@epam/ai-dial-ui-kit";
4
+ import { LazyMarkdownEditor as w } from "@epam/ai-dial-ui-kit/editors";
5
+ import { Suspense as te, lazy as T, useCallback as E, useEffect as D, useId as O, useMemo as k, useRef as ne, useState as A } from "react";
6
+ import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
7
+ import { IconFolderPlus as re, IconPencil as P, IconTrashX as F } from "@tabler/icons-react";
8
+ //#region src/constants/public-class-names.ts
9
+ var I = {
10
+ form: "dial-prompt-editor-form",
11
+ folderField: "dial-prompt-editor-folder-field"
12
+ }, L = {
13
+ contentError: "_contentError_1qtel_1",
14
+ contentInvalid: "_contentInvalid_1qtel_6"
15
+ }, ie = T(async () => ({ default: (await w()).MarkdownEditor })), ae = {
16
+ name: "",
17
+ description: "",
18
+ content: ""
19
+ }, oe = [n.Name, n.Description], se = 2e3, ce = 5e4, R = 10, le = "mx-auto w-full max-w-[1180px] gap-5 px-4 py-6 desktop:px-8 desktop:py-6", ue = 24, de = 480, fe = (e, t, n) => {
20
+ let r = t - e.length;
21
+ return r <= n ? Math.max(r, 0) : null;
22
+ }, z = ({ isEditMode: n = !1, initialValues: m, isLoading: h = !1, hasLoadError: g = !1, isSaving: v = !1, errors: y, descriptionMaxLength: S = se, contentMaxLength: w = ce, counterAnnounceThreshold: T = R, onSubmit: re, onFieldChange: P, onCancel: F, onBack: z = F, onDirtyChange: B, onRetry: V, onRefineDescription: H, onRefineInstructions: U, labels: W, markdownEditorTheme: pe, styles: me }) => {
23
+ let { colors: he, typography: ge } = me ?? {}, _e = ge?.contentLabelClassName ?? "dial-tiny-semi-text", ve = ge?.helperTextClassName ?? "dial-small-text", G = k(() => ({
24
+ ...ae,
25
+ ...m
26
+ }), [m]), [K, q] = A(G), ye = O(), J = O(), be = d({
27
+ bottomGap: ue,
28
+ minHeight: de
29
+ });
30
+ D(() => {
31
+ q(G);
32
+ }, [G]);
33
+ let xe = E((e, t) => {
34
+ q((n) => ({
35
+ ...n,
36
+ [e]: t
37
+ })), P?.(e, t);
38
+ }, [P]), Se = k(() => ({
39
+ name: K.name,
40
+ description: K.description,
41
+ iconUrl: "",
42
+ version: "",
43
+ topics: [],
44
+ otherLocales: []
45
+ }), [K.name, K.description]), Ce = E((e) => {
46
+ q((t) => ({
47
+ ...t,
48
+ ...e.name !== void 0 && { name: e.name },
49
+ ...e.description !== void 0 && { description: e.description }
50
+ })), e.name !== void 0 && P?.("name", e.name), e.description !== void 0 && P?.("description", e.description);
51
+ }, [P]), we = k(() => ({
52
+ name: y?.name,
53
+ description: y?.description
54
+ }), [y?.name, y?.description]), Te = k(() => ({ form: {
55
+ ...e,
56
+ name: {
57
+ label: W?.nameLabel ?? "Name",
58
+ placeholder: W?.namePlaceholder ?? "Prompt name"
59
+ },
60
+ description: {
61
+ label: W?.descriptionLabel ?? "Description",
62
+ placeholder: W?.descriptionPlaceholder ?? "What this prompt is for"
63
+ },
64
+ ariaLabel: void 0
65
+ } }), [
66
+ W?.nameLabel,
67
+ W?.namePlaceholder,
68
+ W?.descriptionLabel,
69
+ W?.descriptionPlaceholder
70
+ ]), Ee = f({
71
+ value: K.description,
72
+ onChange: (e) => xe("description", e),
73
+ onRefine: H,
74
+ disabled: v,
75
+ resetKey: m
76
+ }), De = f({
77
+ value: K.content,
78
+ onChange: (e) => xe("content", e),
79
+ onRefine: U,
80
+ disabled: v,
81
+ resetKey: m
82
+ }), Y = Ee.isPending || De.isPending, Oe = H ? (e, t) => /* @__PURE__ */ M(c, {
83
+ isEnabled: !0,
84
+ fieldId: t,
85
+ label: W?.descriptionLabel ?? "Description",
86
+ labels: W,
87
+ refinement: Ee,
88
+ disabled: Y || v,
89
+ children: e
90
+ }) : void 0, ke = K.name !== G.name || K.description !== G.description || K.content !== G.content, X = p(ke && !B);
91
+ D(() => {
92
+ B?.(ke);
93
+ }, [ke, B]);
94
+ let { guard: Z } = X, { reset: Ae } = Ee, { reset: je } = De, Q = E(() => {
95
+ Ae(), je();
96
+ }, [Ae, je]), Me = E(() => {
97
+ Z(() => {
98
+ Q(), z();
99
+ });
100
+ }, [
101
+ Z,
102
+ Q,
103
+ z
104
+ ]), Ne = E(() => {
105
+ Z(() => {
106
+ Q(), F();
107
+ });
108
+ }, [
109
+ Z,
110
+ Q,
111
+ F
112
+ ]), Pe = E(() => {
113
+ v || Y || re(K);
114
+ }, [
115
+ v,
116
+ Y,
117
+ re,
118
+ K
119
+ ]), Fe = y?.content != null && !y?.name && !y?.description, Ie = ne(!1);
120
+ D(() => {
121
+ Fe && !Ie.current && document.getElementById(J)?.focus(), Ie.current = Fe;
122
+ }, [Fe, J]);
123
+ let Le = n ? W?.editTitle ?? "Edit prompt" : W?.createTitle ?? "Create prompt", Re = n ? W?.saveLabel ?? "Save" : W?.createLabel ?? "Create", ze = k(() => ({
124
+ cancelLabel: W?.cancelLabel ?? "Cancel",
125
+ backAriaLabel: W?.backButtonAriaLabel ?? "Back to prompts",
126
+ savingStatusLabel: W?.savingStatusLabel ?? "Saving"
127
+ }), [
128
+ W?.cancelLabel,
129
+ W?.backButtonAriaLabel,
130
+ W?.savingStatusLabel
131
+ ]), Be = l({
132
+ "--pe-content-error": he?.contentErrorText,
133
+ "--pe-content-invalid-border": he?.contentInvalidBorder
134
+ }), $ = {
135
+ title: Le,
136
+ onBack: z,
137
+ onCancel: F,
138
+ onSubmit: Pe,
139
+ submitLabel: Re,
140
+ labels: ze,
141
+ metadataTitle: null
142
+ };
143
+ if (h) return /* @__PURE__ */ M(t, {
144
+ ...$,
145
+ isSubmitting: v,
146
+ metadata: /* @__PURE__ */ M("div", {
147
+ role: "status",
148
+ "aria-label": W?.loadingAriaLabel ?? "Loading prompt",
149
+ className: "flex flex-1 items-center justify-center p-8",
150
+ children: /* @__PURE__ */ M(C, {})
151
+ })
152
+ });
153
+ if (g) return /* @__PURE__ */ M(t, {
154
+ ...$,
155
+ metadata: /* @__PURE__ */ N("div", {
156
+ role: "alert",
157
+ className: "flex flex-col items-start gap-3",
158
+ children: [/* @__PURE__ */ M("p", {
159
+ className: u("m-0", ve),
160
+ children: W?.loadErrorMessage ?? "Couldn't load this prompt. Please try again."
161
+ }), V != null && /* @__PURE__ */ M(x, {
162
+ label: W?.retryLabel ?? "Retry",
163
+ onClick: V
164
+ })]
165
+ })
166
+ });
167
+ let Ve = fe(K.description, S, T), He = fe(K.content, w, T), Ue = (e) => W?.charactersRemaining?.(e) ?? `${e} characters remaining`, We = W?.contentLabel ?? "Instructions", Ge = /* @__PURE__ */ M("div", {
168
+ ref: be,
169
+ className: u(o, a, s, y?.content != null && L.contentInvalid),
170
+ children: /* @__PURE__ */ M(te, {
171
+ fallback: /* @__PURE__ */ M(C, { ariaLabel: W?.contentLoadingAriaLabel ?? "Loading prompt editor" }),
172
+ children: /* @__PURE__ */ M(ie, {
173
+ id: J,
174
+ value: K.content,
175
+ onChange: (e) => xe("content", e),
176
+ height: 480,
177
+ placeholder: W?.contentPlaceholder ?? "Write the prompt instructions",
178
+ theme: pe,
179
+ showDragbar: !1
180
+ })
181
+ })
182
+ }), Ke = /* @__PURE__ */ M(_, {
183
+ text: y?.content,
184
+ className: u(ve, L.contentError)
185
+ });
186
+ return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(t, {
187
+ ...$,
188
+ onBack: Me,
189
+ onCancel: Ne,
190
+ isSubmitting: v,
191
+ isSubmitDisabled: Y,
192
+ metadataSectionClassName: u(le, I.form),
193
+ metadata: /* @__PURE__ */ N(j, { children: [
194
+ /* @__PURE__ */ M(r, {
195
+ values: Se,
196
+ errors: we,
197
+ onChange: Ce,
198
+ fields: oe,
199
+ renderDescription: Oe,
200
+ labels: Te,
201
+ descriptionCaption: K.description ? `${K.description.length}/${S}` : void 0
202
+ }),
203
+ U ? /* @__PURE__ */ M("div", {
204
+ className: "flex flex-1 flex-col",
205
+ style: Be,
206
+ children: /* @__PURE__ */ M(c, {
207
+ isEnabled: !0,
208
+ fieldId: J,
209
+ label: We,
210
+ labelClassName: _e,
211
+ required: !0,
212
+ labels: W,
213
+ refinement: De,
214
+ disabled: Y || v,
215
+ children: /* @__PURE__ */ N("div", {
216
+ className: "flex flex-col gap-2",
217
+ children: [Ge, Ke]
218
+ })
219
+ })
220
+ }) : /* @__PURE__ */ N("div", {
221
+ role: "group",
222
+ "aria-labelledby": ye,
223
+ className: "flex flex-1 flex-col gap-2",
224
+ style: Be,
225
+ children: [
226
+ /* @__PURE__ */ M(b, {
227
+ id: ye,
228
+ htmlFor: J,
229
+ label: We,
230
+ required: !0,
231
+ className: _e
232
+ }),
233
+ Ge,
234
+ Ke
235
+ ]
236
+ }),
237
+ /* @__PURE__ */ N("span", {
238
+ role: "status",
239
+ "aria-live": "polite",
240
+ className: "sr-only",
241
+ children: [Ve != null && Ue(Ve), He != null && Ue(He)]
242
+ })
243
+ ] })
244
+ }), X.isConfirmOpen && /* @__PURE__ */ M(i, {
245
+ open: !0,
246
+ title: W?.discardTitle ?? "Discard unsaved changes?",
247
+ message: W?.discardMessage ?? "You have unsaved changes. Leaving now will discard them.",
248
+ confirmLabel: W?.discardConfirmLabel ?? "Discard",
249
+ cancelLabel: W?.discardCancelLabel ?? "Keep editing",
250
+ variant: ee.Danger,
251
+ onConfirm: X.confirm,
252
+ onClose: X.dismiss
253
+ })] });
254
+ }, B = /* @__PURE__ */ function(e) {
255
+ return e.Create = "create", e.Rename = "rename", e.ConfirmDelete = "confirmDelete", e;
256
+ }({}), V = "", H = "__root__", U = (e) => e.split("/").pop() ?? "", W = ({ value: e, folders: t, error: n, nameError: r, actions: i, disabled: a = !1, labels: o, helperTextClassName: s = "dial-small-text", onChange: c }) => {
257
+ let [l, d] = A(null), [f, p] = A(""), [ee, _] = A(), [b, C] = A(!1), w = e === V, te = o?.folderRootOption ?? "Root", T = o?.folderEmptyState ?? "No folders yet", D = k(() => [{
258
+ value: H,
259
+ label: te
260
+ }, ...t.map((e) => ({
261
+ value: e.id,
262
+ label: e.id
263
+ }))], [t, te]), O = E(() => {
264
+ d(null), p(""), _(void 0);
265
+ }, []), ne = E(async () => {
266
+ if (b || i == null) return;
267
+ let t = f.trim(), n = i.onValidateFolderName?.(t);
268
+ if (n != null) _(n);
269
+ else {
270
+ _(void 0), C(!0);
271
+ try {
272
+ if (l === B.Create) {
273
+ let n = await i.onCreateFolder(t, w ? void 0 : e);
274
+ typeof n == "string" && c(n);
275
+ } else {
276
+ let n = await i.onRenameFolder(e, t);
277
+ typeof n == "string" && c(n);
278
+ }
279
+ O();
280
+ } catch {} finally {
281
+ C(!1);
282
+ }
283
+ }
284
+ }, [
285
+ b,
286
+ i,
287
+ f,
288
+ l,
289
+ w,
290
+ e,
291
+ c,
292
+ O
293
+ ]), L = E(async () => {
294
+ if (!(b || i == null)) {
295
+ C(!0);
296
+ try {
297
+ await i.onDeleteFolder(e), c(V), O();
298
+ } catch {} finally {
299
+ C(!1);
300
+ }
301
+ }
302
+ }, [
303
+ b,
304
+ i,
305
+ e,
306
+ c,
307
+ O
308
+ ]), ie = E(() => {
309
+ p(""), _(void 0), d(B.Create);
310
+ }, []), ae = E(() => {
311
+ p(U(e)), _(void 0), d(B.Rename);
312
+ }, [e]), oe = E(() => {
313
+ _(void 0), d(B.ConfirmDelete);
314
+ }, []), se = E((e) => {
315
+ let t = Array.isArray(e) ? e[0] : e;
316
+ t != null && c(t === H ? V : t);
317
+ }, [c]), ce = l === B.Create || l === B.Rename, R = ee ?? r;
318
+ return /* @__PURE__ */ N("div", {
319
+ className: u("flex flex-col gap-2", I.folderField),
320
+ children: [
321
+ /* @__PURE__ */ N("div", {
322
+ className: "flex items-end gap-2",
323
+ children: [/* @__PURE__ */ M(S, {
324
+ id: "prompt-folder",
325
+ className: "flex-1",
326
+ options: D,
327
+ value: w ? H : e,
328
+ labelProps: { label: o?.folderLabel ?? "Folder" },
329
+ invalid: n != null,
330
+ disabled: a,
331
+ error: n,
332
+ emptyStateTitle: T,
333
+ onChange: se
334
+ }), i != null && !a && /* @__PURE__ */ N(j, { children: [
335
+ /* @__PURE__ */ M(v, {
336
+ icon: /* @__PURE__ */ M(re, {
337
+ size: m.SM,
338
+ "aria-hidden": !0,
339
+ stroke: h
340
+ }),
341
+ "aria-label": o?.folderCreateLabel ?? "Create folder",
342
+ onClick: ie
343
+ }),
344
+ /* @__PURE__ */ M(v, {
345
+ icon: /* @__PURE__ */ M(P, {
346
+ size: m.SM,
347
+ "aria-hidden": !0,
348
+ stroke: h
349
+ }),
350
+ "aria-label": o?.folderRenameLabel ?? "Rename folder",
351
+ disabled: w,
352
+ onClick: ae
353
+ }),
354
+ /* @__PURE__ */ M(v, {
355
+ icon: /* @__PURE__ */ M(F, {
356
+ size: m.SM,
357
+ "aria-hidden": !0,
358
+ stroke: h
359
+ }),
360
+ "aria-label": o?.folderDeleteLabel ?? "Delete folder",
361
+ disabled: w,
362
+ onClick: oe
363
+ })
364
+ ] })]
365
+ }),
366
+ t.length === 0 && l == null && /* @__PURE__ */ M("p", {
367
+ className: u("m-0", s),
368
+ children: T
369
+ }),
370
+ ce && /* @__PURE__ */ N("div", {
371
+ role: "group",
372
+ "aria-label": l === B.Create ? o?.folderCreateLabel ?? "Create folder" : o?.folderRenameLabel ?? "Rename folder",
373
+ className: "flex items-end gap-2",
374
+ children: [
375
+ /* @__PURE__ */ M(y, {
376
+ id: "prompt-folder-name",
377
+ className: "flex-1",
378
+ value: f,
379
+ autoFocus: !0,
380
+ labelProps: {
381
+ label: o?.folderNameLabel ?? "Folder name",
382
+ required: !0
383
+ },
384
+ invalid: R != null,
385
+ error: R,
386
+ onChange: (e) => p(e ?? "")
387
+ }),
388
+ /* @__PURE__ */ M(x, {
389
+ size: g.Standard,
390
+ label: o?.saveLabel ?? "Save",
391
+ disabled: b,
392
+ onClick: ne
393
+ }),
394
+ /* @__PURE__ */ M(x, {
395
+ size: g.Standard,
396
+ label: o?.cancelLabel ?? "Cancel",
397
+ disabled: b,
398
+ onClick: O
399
+ })
400
+ ]
401
+ }),
402
+ l === B.ConfirmDelete && /* @__PURE__ */ N("div", {
403
+ role: "alertdialog",
404
+ "aria-label": o?.folderDeleteConfirmTitle ?? "Delete folder",
405
+ children: [/* @__PURE__ */ M("p", {
406
+ className: u("m-0 mb-2", s),
407
+ children: o?.folderDeleteConfirmMessage?.(e) ?? `Delete "${e}" and every prompt inside it?`
408
+ }), /* @__PURE__ */ N("div", {
409
+ className: "flex gap-2",
410
+ children: [/* @__PURE__ */ M(x, {
411
+ size: g.Standard,
412
+ label: o?.folderDeleteLabel ?? "Delete folder",
413
+ autoFocus: !0,
414
+ disabled: b,
415
+ onClick: L
416
+ }), /* @__PURE__ */ M(x, {
417
+ size: g.Standard,
418
+ label: o?.cancelLabel ?? "Cancel",
419
+ disabled: b,
420
+ onClick: O
421
+ })]
422
+ })]
423
+ })
424
+ ]
425
+ });
426
+ };
427
+ //#endregion
428
+ export { B as FolderFormMode, I as PROMPT_EDITOR_CLASS, z as PromptEditor, W as PromptFolderField };
@@ -0,0 +1,179 @@
1
+ import { TextRefinementCallback, TextRefinementLabels } from '../../../chat-shared/src/index.ts';
2
+ import { EditorThemes } from '@epam/ai-dial-ui-kit';
3
+ /** One selectable folder in the prompt editor's folder picker. */
4
+ export interface PromptEditorFolder {
5
+ /** Folder path, used as the option's value. The empty string is never listed — the root option is synthesised. */
6
+ id: string;
7
+ /** Display name shown in the picker. */
8
+ name: string;
9
+ }
10
+ /** The prompt fields the editor form holds. */
11
+ export interface PromptEditorValues {
12
+ /** Prompt name. */
13
+ name: string;
14
+ /** Optional short description. */
15
+ description: string;
16
+ /** The prompt body. */
17
+ content: string;
18
+ }
19
+ /**
20
+ * Inline validation messages, keyed by field. Resolved by the host, which owns
21
+ * the storage contract the values must satisfy.
22
+ */
23
+ export interface PromptEditorErrors {
24
+ /** Message shown under the name field. */
25
+ name?: string;
26
+ /** Message shown under the description field. */
27
+ description?: string;
28
+ /** Message shown under the content field. */
29
+ content?: string;
30
+ }
31
+ /** Folder mutations the host performs on the editor's behalf. */
32
+ export interface PromptFolderActions {
33
+ /** Creates a folder; resolve with its new path so the picker can select it. `parentId` is absent for a root-level folder. */
34
+ onCreateFolder: (name: string, parentId?: string) => Promise<string | void>;
35
+ /** Renames a folder; resolve with its new path so the picker can follow it. */
36
+ onRenameFolder: (folderId: string, name: string) => Promise<string | void>;
37
+ /** Deletes a folder and everything under it. */
38
+ onDeleteFolder: (folderId: string) => Promise<void>;
39
+ /** Validates a folder name before any mutation is dispatched; return a message to block it. */
40
+ onValidateFolderName?: (name: string) => string | undefined;
41
+ }
42
+ /** Text overrides for `PromptEditor`. Every field has an English default. */
43
+ export interface PromptEditorLabels extends TextRefinementLabels {
44
+ /** Heading shown in create mode. Defaults to `'Create prompt'`. */
45
+ createTitle?: string;
46
+ /** Heading shown in edit mode. Defaults to `'Edit prompt'`. */
47
+ editTitle?: string;
48
+ /** Accessible label of the header back button. Defaults to `'Back to prompts'`. */
49
+ backButtonAriaLabel?: string;
50
+ /** Name field label. Defaults to `'Name'`. */
51
+ nameLabel?: string;
52
+ /** Name field placeholder. Defaults to `'Prompt name'`. */
53
+ namePlaceholder?: string;
54
+ /** Description field label. Defaults to `'Description'`. */
55
+ descriptionLabel?: string;
56
+ /** Description field placeholder. Defaults to `'What this prompt is for'`. */
57
+ descriptionPlaceholder?: string;
58
+ /** Content field label. Defaults to `'Instructions'`. */
59
+ contentLabel?: string;
60
+ /** Content field placeholder. Defaults to `'Write the prompt instructions'`. */
61
+ contentPlaceholder?: string;
62
+ /** Folder picker label, used by the standalone `PromptFolderField`. Defaults to `'Folder'`. */
63
+ folderLabel?: string;
64
+ /** Label of the root option in the folder picker. Defaults to `'Root'`. */
65
+ folderRootOption?: string;
66
+ /** Text shown when there are no folders yet. Defaults to `'No folders yet'`. */
67
+ folderEmptyState?: string;
68
+ /** Accessible label of the create-folder button. Defaults to `'Create folder'`. */
69
+ folderCreateLabel?: string;
70
+ /** Accessible label of the rename-folder button. Defaults to `'Rename folder'`. */
71
+ folderRenameLabel?: string;
72
+ /** Accessible label of the delete-folder button. Defaults to `'Delete folder'`. */
73
+ folderDeleteLabel?: string;
74
+ /** Label of the folder-name field in the create/rename sub-form. Defaults to `'Folder name'`. */
75
+ folderNameLabel?: string;
76
+ /** Title of the delete-folder confirmation. Defaults to `'Delete folder'`. */
77
+ folderDeleteConfirmTitle?: string;
78
+ /** Builds the delete-folder confirmation message. Defaults to a sentence naming the folder. */
79
+ folderDeleteConfirmMessage?: (folderId: string) => string;
80
+ /** Primary button label in create mode. Defaults to `'Create'`. */
81
+ createLabel?: string;
82
+ /** Primary button label in edit mode. Defaults to `'Save'`. */
83
+ saveLabel?: string;
84
+ /** Cancel button label. Defaults to `'Cancel'`. */
85
+ cancelLabel?: string;
86
+ /** Retry button label shown in the load-error state. Defaults to `'Retry'`. */
87
+ retryLabel?: string;
88
+ /** Message shown when the prompt could not be loaded. Defaults to `"Couldn't load this prompt. Please try again."`. */
89
+ loadErrorMessage?: string;
90
+ /** Status announced while a save is in flight. Defaults to `'Saving'`. */
91
+ savingStatusLabel?: string;
92
+ /** Accessible label of the loading spinner. Defaults to `'Loading prompt'`. */
93
+ loadingAriaLabel?: string;
94
+ /** Accessible label of the markdown editor loading spinner. Defaults to `'Loading prompt editor'`. */
95
+ contentLoadingAriaLabel?: string;
96
+ /** Builds the characters-remaining announcement. Defaults to `` `${count} characters remaining` ``. */
97
+ charactersRemaining?: (count: number) => string;
98
+ /** Title of the confirmation shown when leaving with unsaved changes. Defaults to `'Discard unsaved changes?'`. */
99
+ discardTitle?: string;
100
+ /** Message of the unsaved-changes confirmation. Defaults to `'You have unsaved changes. Leaving now will discard them.'`. */
101
+ discardMessage?: string;
102
+ /** Confirm button label of the unsaved-changes confirmation. Defaults to `'Discard'`. */
103
+ discardConfirmLabel?: string;
104
+ /** Cancel button label of the unsaved-changes confirmation. Defaults to `'Keep editing'`. */
105
+ discardCancelLabel?: string;
106
+ }
107
+ /** Typography class overrides for `PromptEditor`. */
108
+ export interface PromptEditorTypography {
109
+ /** Class applied to the prompt editor label. Defaults to `'dial-tiny-semi-text'`. */
110
+ contentLabelClassName?: string;
111
+ /** Class applied to helper, error, and confirmation text. Defaults to `'dial-small-text'`. */
112
+ helperTextClassName?: string;
113
+ }
114
+ /** Color overrides for `PromptEditor`. */
115
+ export interface PromptEditorColors {
116
+ /** Prompt validation error text. Fallback: `--text-error`. */
117
+ contentErrorText?: string;
118
+ /** Border of the instructions editor while it has an error. Fallback: `--stroke-error`. */
119
+ contentInvalidBorder?: string;
120
+ }
121
+ /** Grouped style overrides for `PromptEditor`. */
122
+ export interface PromptEditorStyles {
123
+ /** Color overrides applied as CSS custom properties. */
124
+ colors?: PromptEditorColors;
125
+ /** Typography class overrides. */
126
+ typography?: PromptEditorTypography;
127
+ }
128
+ /** Props for `PromptEditor`. */
129
+ export interface PromptEditorProps {
130
+ /** Whether the form edits an existing prompt (changes the heading and the primary button label). Defaults to `false`. */
131
+ isEditMode?: boolean;
132
+ /**
133
+ * Values to seed the fields with. Changing this object's identity re-seeds
134
+ * the form, so hosts that load asynchronously should memoise it and only
135
+ * produce a new object once the data has arrived.
136
+ */
137
+ initialValues?: Partial<PromptEditorValues>;
138
+ /** Whether the prompt being edited is still loading. Defaults to `false`. */
139
+ isLoading?: boolean;
140
+ /** Whether loading the prompt failed; renders an error state with a retry instead of the form. Defaults to `false`. */
141
+ hasLoadError?: boolean;
142
+ /** Whether a save is in flight; disables submission. Defaults to `false`. */
143
+ isSaving?: boolean;
144
+ /** Inline validation messages to render under the fields. */
145
+ errors?: PromptEditorErrors;
146
+ /** Description length limit, shown as a `length/limit` counter under it and used for the characters-remaining announcement; input is not capped. Defaults to `2000`. */
147
+ descriptionMaxLength?: number;
148
+ /** Maximum content length used for the characters-remaining announcement. Defaults to `50000`. */
149
+ contentMaxLength?: number;
150
+ /** How close to a limit the announcement starts, in characters. Defaults to `10`. */
151
+ counterAnnounceThreshold?: number;
152
+ /** Called with the current values when the form is submitted. */
153
+ onSubmit: (values: PromptEditorValues) => void;
154
+ /** Called with each edited field and its new value, e.g. to validate while the user types. */
155
+ onFieldChange?: (field: keyof PromptEditorValues, value: string) => void;
156
+ /** Called when the form is dismissed without saving; with unsaved edits and no `onDirtyChange`, only after the user confirms discarding them. */
157
+ onCancel: () => void;
158
+ /** Called when the header back button is activated, behind the same unsaved-changes confirmation as `onCancel`. Defaults to `onCancel`. */
159
+ onBack?: () => void;
160
+ /**
161
+ * Called with whether the form holds unsaved edits, on mount and whenever that changes.
162
+ * Providing it hands unsaved-changes handling to the host: the built-in discard confirmation
163
+ * and unload warning are turned off, and Back/Cancel call `onBack`/`onCancel` directly.
164
+ */
165
+ onDirtyChange?: (isDirty: boolean) => void;
166
+ /** Called when the retry button in the load-error state is activated. */
167
+ onRetry?: () => void;
168
+ /** Optional Description rewrite callback; omission hides the Refine with AI action. */
169
+ onRefineDescription?: TextRefinementCallback;
170
+ /** Optional Instructions rewrite callback; omission hides the Refine with AI action. */
171
+ onRefineInstructions?: TextRefinementCallback;
172
+ /** Text overrides. */
173
+ labels?: PromptEditorLabels;
174
+ /** Theme applied to the prompt markdown editor. Defaults to the editor's own default (`EditorThemes.light`). */
175
+ markdownEditorTheme?: EditorThemes;
176
+ /** Style overrides. */
177
+ styles?: PromptEditorStyles;
178
+ }
179
+ //# sourceMappingURL=prompt-editor-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-editor-props.d.ts","sourceRoot":"","sources":["../../src/models/prompt-editor-props.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,23 @@
1
+ import { PromptEditorFolder, PromptEditorLabels, PromptFolderActions } from './prompt-editor-props';
2
+ /** Props for `PromptFolderField`. */
3
+ export interface PromptFolderFieldProps {
4
+ /** Currently selected folder path. The empty string means the root folder. */
5
+ value: string;
6
+ /** Folders offered by the picker, excluding the root. */
7
+ folders: PromptEditorFolder[];
8
+ /** Message shown under the picker itself. */
9
+ error?: string;
10
+ /** Message shown under the folder-name field of the create/rename sub-form. */
11
+ nameError?: string;
12
+ /** Folder mutations. Omit to render the picker without create/rename/delete controls. */
13
+ actions?: PromptFolderActions;
14
+ /** Whether the selected folder is read-only. */
15
+ disabled?: boolean;
16
+ /** Text overrides, shared with `PromptEditor`. */
17
+ labels?: PromptEditorLabels;
18
+ /** Class applied to helper and confirmation text. Defaults to `'dial-small-text'`. */
19
+ helperTextClassName?: string;
20
+ /** Called with the newly selected folder path (the empty string for root). */
21
+ onChange: (folderId: string) => void;
22
+ }
23
+ //# sourceMappingURL=prompt-folder-field-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-folder-field-props.d.ts","sourceRoot":"","sources":["../../src/models/prompt-folder-field-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,qCAAqC;AACrC,MAAM,WAAW,sBAAsB;IACrC,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yFAAyF;IACzF,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC"}
package/package.json CHANGED
@@ -1,6 +1,35 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-prompt-editor",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "description": "Host-agnostic form for authoring a reusable prompt, with an inline folder picker",
4
+ "version": "1.3.0-dev.221",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "main": "./index.js",
8
+ "module": "./index.js",
9
+ "types": "./index.d.ts",
10
+ "exports": {
11
+ "./package.json": "./package.json",
12
+ "./styles.css": "./index.css",
13
+ ".": {
14
+ "types": "./index.d.ts",
15
+ "import": "./index.js",
16
+ "default": "./index.js"
17
+ }
18
+ },
19
+ "dependencies": {
20
+ "@tabler/icons-react": "^3.44.0",
21
+ "@uiw/react-markdown-preview": "^5.2.1",
22
+ "@uiw/react-md-editor": "^4.1.1",
23
+ "@epam/ai-dial-builder-form": "1.3.0-dev.221"
24
+ },
25
+ "peerDependencies": {
26
+ "@epam/ai-dial-chat-shared": "1.3.0-dev.221",
27
+ "@epam/ai-dial-ui-kit": "^0.16.0-dev.45",
28
+ "react": "^19.2.8"
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/epam/ai-dial-chat.git",
33
+ "directory": "libs/prompt-editor"
34
+ }
35
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=test-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ /** Which inline folder sub-form the folder field is currently showing, if any. */
2
+ export declare enum FolderFormMode {
3
+ /** Creating a new folder under the selected one. */
4
+ Create = "create",
5
+ /** Renaming the selected folder. */
6
+ Rename = "rename",
7
+ /** Confirming deletion of the selected folder. */
8
+ ConfirmDelete = "confirmDelete"
9
+ }
10
+ //# sourceMappingURL=folder-form-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"folder-form-mode.d.ts","sourceRoot":"","sources":["../../src/types/folder-form-mode.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,oBAAY,cAAc;IACxB,oDAAoD;IACpD,MAAM,WAAW;IACjB,oCAAoC;IACpC,MAAM,WAAW;IACjB,kDAAkD;IAClD,aAAa,kBAAkB;CAChC"}
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.