@fluentui-copilot/react-chat-input-plugins 0.5.2 → 0.5.3
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/CHANGELOG.json +16 -1
- package/CHANGELOG.md +11 -2
- package/lib/BasicFunctionality.js +0 -1
- package/lib/ChatInputEntity.js +0 -1
- package/lib/ChatInputToken.js +0 -1
- package/lib/GhostText.js +0 -1
- package/lib/ImperativeControl.js +0 -1
- package/lib/PasteUnfurling.js +0 -1
- package/lib/components/ChatInputEntity/ChatInputEntity.js +4 -5
- package/lib/components/ChatInputEntity/ChatInputEntity.types.js +2 -3
- package/lib/components/ChatInputEntity/index.js +0 -1
- package/lib/components/ChatInputEntity/renderChatInputEntity.js +9 -8
- package/lib/components/ChatInputEntity/useChatInputEntity.js +40 -44
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js +43 -0
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js.map +1 -0
- package/lib/components/ChatInputToken/ChatInputToken.js +4 -5
- package/lib/components/ChatInputToken/ChatInputToken.node.js +49 -50
- package/lib/components/ChatInputToken/ChatInputToken.types.js +1 -2
- package/lib/components/ChatInputToken/index.js +0 -1
- package/lib/components/ChatInputToken/renderChatInputToken.js +4 -6
- package/lib/components/ChatInputToken/useChatInputToken.js +12 -14
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js +25 -0
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js.map +1 -0
- package/lib/components/GhostText/GhostText.js +4 -5
- package/lib/components/GhostText/GhostText.types.js +2 -3
- package/lib/components/GhostText/index.js +0 -1
- package/lib/components/GhostText/renderGhostText.js +9 -8
- package/lib/components/GhostText/useGhostText.js +36 -39
- package/lib/components/GhostText/useGhostTextStyles.styles.raw.js +35 -0
- package/lib/components/GhostText/useGhostTextStyles.styles.raw.js.map +1 -0
- package/lib/index.js +0 -1
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js +53 -42
- package/lib/plugins/BasicFunctionality/index.js +0 -1
- package/lib/plugins/ChatInputEntity/ChatInputEntity.node.js +67 -68
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.js +37 -38
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js +1 -2
- package/lib/plugins/ChatInputEntity/index.js +0 -1
- package/lib/plugins/GhostText/GhostText.js +43 -37
- package/lib/plugins/GhostText/GhostText.node.js +56 -57
- package/lib/plugins/GhostText/index.js +0 -1
- package/lib/plugins/ImperativeControl/ImperativeControl.js +6 -5
- package/lib/plugins/ImperativeControl/index.js +0 -1
- package/lib/plugins/ManualGhostText/ManualGhostText.js +8 -8
- package/lib/plugins/ManualGhostText/index.js +0 -1
- package/lib/plugins/PasteUnfurling/PasteUnfurling.js +14 -14
- package/lib/plugins/PasteUnfurling/index.js +0 -1
- package/lib-commonjs/BasicFunctionality.js +0 -1
- package/lib-commonjs/ChatInputEntity.js +0 -1
- package/lib-commonjs/ChatInputToken.js +0 -1
- package/lib-commonjs/GhostText.js +0 -1
- package/lib-commonjs/ImperativeControl.js +0 -1
- package/lib-commonjs/PasteUnfurling.js +0 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js +1 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js +0 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/index.js +0 -1
- package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js +1 -1
- package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js +59 -0
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.js +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.types.js +0 -1
- package/lib-commonjs/components/ChatInputToken/index.js +0 -1
- package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js +1 -1
- package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputToken.js +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js +41 -0
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/GhostText/GhostText.js +1 -1
- package/lib-commonjs/components/GhostText/GhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/GhostText.types.js +0 -1
- package/lib-commonjs/components/GhostText/GhostText.types.js.map +1 -1
- package/lib-commonjs/components/GhostText/index.js +0 -1
- package/lib-commonjs/components/GhostText/renderGhostText.js +1 -1
- package/lib-commonjs/components/GhostText/renderGhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/useGhostText.js +1 -1
- package/lib-commonjs/components/GhostText/useGhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.raw.js +51 -0
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/index.js +0 -1
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js +1 -1
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
- package/lib-commonjs/plugins/BasicFunctionality/index.js +0 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js.map +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js.map +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js +0 -1
- package/lib-commonjs/plugins/ChatInputEntity/index.js +0 -1
- package/lib-commonjs/plugins/GhostText/GhostText.js +2 -3
- package/lib-commonjs/plugins/GhostText/GhostText.js.map +1 -1
- package/lib-commonjs/plugins/GhostText/GhostText.node.js +1 -1
- package/lib-commonjs/plugins/GhostText/GhostText.node.js.map +1 -1
- package/lib-commonjs/plugins/GhostText/index.js +0 -1
- package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js +1 -1
- package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js.map +1 -1
- package/lib-commonjs/plugins/ImperativeControl/index.js +0 -1
- package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js +1 -1
- package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js.map +1 -1
- package/lib-commonjs/plugins/ManualGhostText/index.js +0 -1
- package/lib-commonjs/plugins/PasteUnfurling/PasteUnfurling.js +1 -1
- package/lib-commonjs/plugins/PasteUnfurling/PasteUnfurling.js.map +1 -1
- package/lib-commonjs/plugins/PasteUnfurling/index.js +0 -1
- package/package.json +5 -5
|
@@ -3,65 +3,64 @@ import * as React from 'react';
|
|
|
3
3
|
import { DecoratorNode } from '@fluentui-copilot/text-editor';
|
|
4
4
|
import { GhostText } from '../../components/GhostText/GhostText';
|
|
5
5
|
export class GhostTextNode extends DecoratorNode {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
6
|
+
static clone(node) {
|
|
7
|
+
return new GhostTextNode(node.__id, node.__content, node.__exposeText, node.__componentProps, node.__key);
|
|
8
|
+
}
|
|
9
|
+
static getType() {
|
|
10
|
+
return 'ghosttext';
|
|
11
|
+
}
|
|
12
|
+
static importJSON(serializedNode) {
|
|
13
|
+
const node = $createGhostTextNode(serializedNode.id, serializedNode.content, serializedNode.exposeText, serializedNode.componentProps);
|
|
14
|
+
return node;
|
|
15
|
+
}
|
|
16
|
+
exportJSON() {
|
|
17
|
+
return {
|
|
18
|
+
type: 'ghosttext',
|
|
19
|
+
id: this.__id,
|
|
20
|
+
content: this.__content,
|
|
21
|
+
componentProps: this.__componentProps,
|
|
22
|
+
exposeText: this.__exposeText,
|
|
23
|
+
version: 1
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
isInline() {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
isIsolated() {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
getTextContent() {
|
|
33
|
+
return this.__exposeText ? this.__content : '';
|
|
34
|
+
}
|
|
35
|
+
updateDOM(prevNode, dom, config) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
createDOM(config) {
|
|
39
|
+
// eslint-disable-next-line no-restricted-globals
|
|
40
|
+
return document.createElement('span');
|
|
41
|
+
}
|
|
42
|
+
decorate() {
|
|
43
|
+
return /*#__PURE__*/ React.createElement(GhostText, {
|
|
44
|
+
nodeKey: this.getKey(),
|
|
45
|
+
...this.__componentProps
|
|
46
|
+
}, this.__content);
|
|
47
|
+
}
|
|
48
|
+
constructor(id, content, exposeText, componentProps, key){
|
|
49
|
+
super(key);
|
|
50
|
+
_define_property(this, "__content", void 0);
|
|
51
|
+
_define_property(this, "__id", void 0);
|
|
52
|
+
_define_property(this, "__allowCommitting", void 0);
|
|
53
|
+
_define_property(this, "__componentProps", void 0);
|
|
54
|
+
_define_property(this, "__exposeText", void 0);
|
|
55
|
+
this.__id = id;
|
|
56
|
+
this.__content = content;
|
|
57
|
+
this.__exposeText = exposeText;
|
|
58
|
+
this.__componentProps = componentProps;
|
|
59
|
+
}
|
|
60
60
|
}
|
|
61
61
|
export function $createGhostTextNode(id, content, exposeText, componentProps) {
|
|
62
|
-
|
|
62
|
+
return new GhostTextNode(id, content, exposeText, componentProps);
|
|
63
63
|
}
|
|
64
64
|
export function $isGhostTextNode(node) {
|
|
65
|
-
|
|
65
|
+
return node instanceof GhostTextNode;
|
|
66
66
|
}
|
|
67
|
-
//# sourceMappingURL=GhostText.node.js.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ImperativeControlBase } from '@fluentui-copilot/chat-input-plugins';
|
|
3
3
|
import { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';
|
|
4
|
-
export const ImperativeControlPlugin = /*#__PURE__*/React.forwardRef((_props, ref)
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export const ImperativeControlPlugin = /*#__PURE__*/ React.forwardRef((_props, ref)=>{
|
|
5
|
+
const [editor] = useLexicalComposerContext();
|
|
6
|
+
React.useImperativeHandle(ref, ()=>new ImperativeControlBase(editor), [
|
|
7
|
+
editor
|
|
8
|
+
]);
|
|
9
|
+
return null;
|
|
8
10
|
});
|
|
9
|
-
//# sourceMappingURL=ImperativeControl.js.map
|
|
@@ -2,13 +2,13 @@ import * as React from 'react';
|
|
|
2
2
|
import { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';
|
|
3
3
|
import { $createGhostTextNode, $isGhostTextNode } from '../../GhostText';
|
|
4
4
|
import { ManualGhostTextBase } from '@fluentui-copilot/chat-input-plugins';
|
|
5
|
-
export const ManualGhostTextPlugin = React.forwardRef((props, ref)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
export const ManualGhostTextPlugin = React.forwardRef((props, ref)=>{
|
|
6
|
+
const { id } = props;
|
|
7
|
+
const [editor] = useLexicalComposerContext();
|
|
8
|
+
React.useImperativeHandle(ref, ()=>new ManualGhostTextBase(editor, id, $isGhostTextNode, $createGhostTextNode), [
|
|
9
|
+
editor,
|
|
10
|
+
id
|
|
11
|
+
]);
|
|
12
|
+
return null;
|
|
12
13
|
});
|
|
13
14
|
ManualGhostTextPlugin.displayName = 'ManualGhostTextPlugin';
|
|
14
|
-
//# sourceMappingURL=ManualGhostText.js.map
|
|
@@ -2,18 +2,18 @@ import * as React from 'react';
|
|
|
2
2
|
import { registerPasteUnfurlingPlugin } from '@fluentui-copilot/chat-input-plugins';
|
|
3
3
|
import { $createChatInputEntityNode } from '../../ChatInputEntity';
|
|
4
4
|
import { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';
|
|
5
|
-
export const PasteUnfurlingPlugin = props
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
export const PasteUnfurlingPlugin = (props)=>{
|
|
6
|
+
const { $createEntityNode = $createChatInputEntityNode, ...rest } = props;
|
|
7
|
+
const [editor] = useLexicalComposerContext();
|
|
8
|
+
React.useEffect(()=>{
|
|
9
|
+
return registerPasteUnfurlingPlugin(editor, {
|
|
10
|
+
...rest,
|
|
11
|
+
$createEntityNode
|
|
12
|
+
});
|
|
13
|
+
}, [
|
|
14
|
+
$createEntityNode,
|
|
15
|
+
editor,
|
|
16
|
+
rest
|
|
17
|
+
]);
|
|
18
|
+
return null;
|
|
18
19
|
};
|
|
19
|
-
//# sourceMappingURL=PasteUnfurling.js.map
|
|
@@ -18,4 +18,4 @@ const ChatInputEntity = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
18
18
|
(0, _useChatInputEntityStylesstyles.useChatInputEntityStyles_unstable)(state);
|
|
19
19
|
return (0, _renderChatInputEntity.renderChatInputEntity_unstable)(state);
|
|
20
20
|
});
|
|
21
|
-
ChatInputEntity.displayName = 'ChatInputEntity';
|
|
21
|
+
ChatInputEntity.displayName = 'ChatInputEntity';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatInputEntity.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useChatInputEntity_unstable } from './useChatInputEntity';\nimport { renderChatInputEntity_unstable } from './renderChatInputEntity';\nimport { useChatInputEntityStyles_unstable } from './useChatInputEntityStyles.styles';\nimport type { ChatInputEntityProps } from './ChatInputEntity.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ChatInputEntity component - TODO: add more docs\nexport const ChatInputEntity: ForwardRefComponent<ChatInputEntityProps> = React.forwardRef((props, ref) => {\n const state = useChatInputEntity_unstable(props, ref);\n\n useChatInputEntityStyles_unstable(state);\n return renderChatInputEntity_unstable(state);\n});\n\nChatInputEntity.displayName = 'ChatInputEntity';\n"],"names":["ChatInputEntity","React","forwardRef","props","state","useChatInputEntity_unstable","useChatInputEntityStyles_unstable","renderChatInputEntity_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;oCACqB;uCACG;gDACG;AAK3C,MAAMA,kBAAAA,WAAAA,
|
|
1
|
+
{"version":3,"sources":["ChatInputEntity.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useChatInputEntity_unstable } from './useChatInputEntity';\nimport { renderChatInputEntity_unstable } from './renderChatInputEntity';\nimport { useChatInputEntityStyles_unstable } from './useChatInputEntityStyles.styles';\nimport type { ChatInputEntityProps } from './ChatInputEntity.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ChatInputEntity component - TODO: add more docs\nexport const ChatInputEntity: ForwardRefComponent<ChatInputEntityProps> = React.forwardRef((props, ref) => {\n const state = useChatInputEntity_unstable(props, ref);\n\n useChatInputEntityStyles_unstable(state);\n return renderChatInputEntity_unstable(state);\n});\n\nChatInputEntity.displayName = 'ChatInputEntity';\n"],"names":["ChatInputEntity","React","forwardRef","props","ref","state","useChatInputEntity_unstable","useChatInputEntityStyles_unstable","renderChatInputEntity_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;oCACqB;uCACG;gDACG;AAK3C,MAAMA,kBAAAA,WAAAA,GAA6DC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQC,IAAAA,+CAAAA,EAA4BH,OAAOC;IAEjDG,IAAAA,iEAAAA,EAAkCF;IAClC,OAAOG,IAAAA,qDAAAA,EAA+BH;AACxC;AAEAL,gBAAgBS,WAAW,GAAG"}
|
|
@@ -6,4 +6,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
// TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from ChatInputEntityProps.
|
|
8
8
|
// & Required<Pick<ChatInputEntityProps, 'propName'>>
|
|
9
|
-
//# sourceMappingURL=ChatInputEntity.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatInputEntity.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type ChatInputEntitySlots = {\n root: NonNullable<Slot<'span'>>;\n text: Slot<'span', 'a'>;\n sensitivity?: Slot<'span'>;\n};\n\n/**\n * ChatInputEntity Props\n */\nexport type ChatInputEntityProps = ComponentProps<Partial<ChatInputEntitySlots>, 'text'> & {};\n\n/**\n * State used in rendering ChatInputEntity\n */\nexport type ChatInputEntityState = ComponentState<ChatInputEntitySlots>;\n// TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from ChatInputEntityProps.\n// & Required<Pick<ChatInputEntityProps, 'propName'>>\n"],"names":[],"rangeMappings":";;;;;;;","mappings":"AAaA;;CAEC;;;;
|
|
1
|
+
{"version":3,"sources":["ChatInputEntity.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type ChatInputEntitySlots = {\n root: NonNullable<Slot<'span'>>;\n text: Slot<'span', 'a'>;\n sensitivity?: Slot<'span'>;\n};\n\n/**\n * ChatInputEntity Props\n */\nexport type ChatInputEntityProps = ComponentProps<Partial<ChatInputEntitySlots>, 'text'> & {};\n\n/**\n * State used in rendering ChatInputEntity\n */\nexport type ChatInputEntityState = ComponentState<ChatInputEntitySlots>;\n// TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from ChatInputEntityProps.\n// & Required<Pick<ChatInputEntityProps, 'propName'>>\n"],"names":[],"rangeMappings":";;;;;;;","mappings":"AAaA;;CAEC;;;;CAED,gIAAgI;CAChI,qDAAqD"}
|
|
@@ -29,4 +29,3 @@ const _ChatInputEntity = require("./ChatInputEntity");
|
|
|
29
29
|
const _renderChatInputEntity = require("./renderChatInputEntity");
|
|
30
30
|
const _useChatInputEntity = require("./useChatInputEntity");
|
|
31
31
|
const _useChatInputEntityStylesstyles = require("./useChatInputEntityStyles.styles");
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderChatInputEntity.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { ChatInputEntityState, ChatInputEntitySlots } from './ChatInputEntity.types';\n\n/**\n * Render the final JSX of ChatInputEntity\n */\nexport const renderChatInputEntity_unstable = (state: ChatInputEntityState) => {\n assertSlots<ChatInputEntitySlots>(state);\n\n return (\n <state.root>\n {state.text && <state.text />}\n {state.sensitivity && <state.sensitivity />}\n </state.root>\n );\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["renderChatInputEntity.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { ChatInputEntityState, ChatInputEntitySlots } from './ChatInputEntity.types';\n\n/**\n * Render the final JSX of ChatInputEntity\n */\nexport const renderChatInputEntity_unstable = (state: ChatInputEntityState) => {\n assertSlots<ChatInputEntitySlots>(state);\n\n return (\n <state.root>\n {state.text && <state.text />}\n {state.sensitivity && <state.sensitivity />}\n </state.root>\n );\n};\n"],"names":["renderChatInputEntity_unstable","state","assertSlots","_jsxs","root","text","_jsx","sensitivity"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;iCAE4B;AAMrB,MAAMA,iCAAiC,CAACC;IAC7CC,IAAAA,4BAAAA,EAAkCD;IAElC,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACF,MAAMG,IAAI,EAAA;;YACRH,MAAMI,IAAI,IAAA,WAAA,GAAIC,IAAAA,eAAA,EAACL,MAAMI,IAAI,EAAA,CAAA;YACzBJ,MAAMM,WAAW,IAAA,WAAA,GAAID,IAAAA,eAAA,EAACL,MAAMM,WAAW,EAAA,CAAA;;;AAG9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useChatInputEntity.ts"],"sourcesContent":["import type * as React from 'react';\nimport { getPartitionedNativeProps, slot } from '@fluentui/react-components';\nimport type { ChatInputEntityProps, ChatInputEntityState } from './ChatInputEntity.types';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\n\n/**\n * Create the state required to render ChatInputEntity.\n *\n * The returned state can be modified with hooks such as useChatInputEntityStyles_unstable,\n * before being passed to renderChatInputEntity_unstable.\n *\n * @param props - props from this instance of ChatInputEntity\n * @param ref - reference to root HTMLElement of ChatInputEntity\n */\nexport const useChatInputEntity_unstable = (\n props: ChatInputEntityProps,\n ref: React.Ref<HTMLSpanElement | HTMLAnchorElement>,\n): ChatInputEntityState => {\n const { as } = props;\n\n const elementType = as ?? 'span';\n\n const nativeProps = getPartitionedNativeProps({ props, primarySlotTagName: elementType });\n\n const defaultTextSlotProps =\n elementType === 'a'\n ? {\n target: '_blank',\n rel: 'noopener',\n // We don't want to enable tab focus for components inside the ChatInput\n tabIndex: -1,\n ...nativeProps.primary,\n as: 'a' as const,\n // This cast is safe to do at this point because we know the type of element we are rendering is an anchor\n ref: ref as React.Ref<HTMLAnchorElement>,\n }\n : { ...nativeProps.primary, as: 'span' as const, ref };\n\n return {\n components: {\n root: 'span',\n sensitivity: 'span',\n text: elementType,\n },\n root: slot.always(props.root, {\n defaultProps: nativeProps.root,\n elementType: 'span',\n }),\n sensitivity: slot.optional(props.sensitivity, { elementType: 'span' }),\n text: slot.optional(props.text, {\n defaultProps: defaultTextSlotProps,\n renderByDefault: true,\n elementType,\n }),\n };\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["useChatInputEntity.ts"],"sourcesContent":["import type * as React from 'react';\nimport { getPartitionedNativeProps, slot } from '@fluentui/react-components';\nimport type { ChatInputEntityProps, ChatInputEntityState } from './ChatInputEntity.types';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\n\n/**\n * Create the state required to render ChatInputEntity.\n *\n * The returned state can be modified with hooks such as useChatInputEntityStyles_unstable,\n * before being passed to renderChatInputEntity_unstable.\n *\n * @param props - props from this instance of ChatInputEntity\n * @param ref - reference to root HTMLElement of ChatInputEntity\n */\nexport const useChatInputEntity_unstable = (\n props: ChatInputEntityProps,\n ref: React.Ref<HTMLSpanElement | HTMLAnchorElement>,\n): ChatInputEntityState => {\n const { as } = props;\n\n const elementType = as ?? 'span';\n\n const nativeProps = getPartitionedNativeProps({ props, primarySlotTagName: elementType });\n\n const defaultTextSlotProps =\n elementType === 'a'\n ? {\n target: '_blank',\n rel: 'noopener',\n // We don't want to enable tab focus for components inside the ChatInput\n tabIndex: -1,\n ...nativeProps.primary,\n as: 'a' as const,\n // This cast is safe to do at this point because we know the type of element we are rendering is an anchor\n ref: ref as React.Ref<HTMLAnchorElement>,\n }\n : { ...nativeProps.primary, as: 'span' as const, ref };\n\n return {\n components: {\n root: 'span',\n sensitivity: 'span',\n text: elementType,\n },\n root: slot.always(props.root, {\n defaultProps: nativeProps.root,\n elementType: 'span',\n }),\n sensitivity: slot.optional(props.sensitivity, { elementType: 'span' }),\n text: slot.optional(props.text, {\n defaultProps: defaultTextSlotProps,\n renderByDefault: true,\n elementType,\n }),\n };\n};\n"],"names":["useChatInputEntity_unstable","props","ref","as","elementType","nativeProps","getPartitionedNativeProps","primarySlotTagName","defaultTextSlotProps","target","rel","tabIndex","primary","components","root","sensitivity","text","slot","always","defaultProps","optional","renderByDefault"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;iCAdmC;AAczC,MAAMA,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,EAAE,EAAE,GAAGF;IAEf,MAAMG,cAAcD,OAAAA,QAAAA,OAAAA,KAAAA,IAAAA,KAAM;IAE1B,MAAME,cAAcC,IAAAA,0CAAAA,EAA0B;QAAEL;QAAOM,oBAAoBH;IAAY;IAEvF,MAAMI,uBACJJ,gBAAgB,MACZ;QACEK,QAAQ;QACRC,KAAK;QACL,wEAAwE;QACxEC,UAAU,CAAC;QACX,GAAGN,YAAYO,OAAO;QACtBT,IAAI;QACJ,0GAA0G;QAC1GD,KAAKA;IACP,IACA;QAAE,GAAGG,YAAYO,OAAO;QAAET,IAAI;QAAiBD;IAAI;IAEzD,OAAO;QACLW,YAAY;YACVC,MAAM;YACNC,aAAa;YACbC,MAAMZ;QACR;QACAU,MAAMG,qBAAAA,CAAKC,MAAM,CAACjB,MAAMa,IAAI,EAAE;YAC5BK,cAAcd,YAAYS,IAAI;YAC9BV,aAAa;QACf;QACAW,aAAaE,qBAAAA,CAAKG,QAAQ,CAACnB,MAAMc,WAAW,EAAE;YAAEX,aAAa;QAAO;QACpEY,MAAMC,qBAAAA,CAAKG,QAAQ,CAACnB,MAAMe,IAAI,EAAE;YAC9BG,cAAcX;YACda,iBAAiB;YACjBjB;QACF;IACF;AACF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
chatInputEntityClassNames: function() {
|
|
13
|
+
return chatInputEntityClassNames;
|
|
14
|
+
},
|
|
15
|
+
useChatInputEntityStyles_unstable: function() {
|
|
16
|
+
return useChatInputEntityStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _tokens = require("@fluentui-copilot/tokens");
|
|
21
|
+
const chatInputEntityClassNames = {
|
|
22
|
+
root: 'fai-ChatInputEntity',
|
|
23
|
+
sensitivity: 'fai-ChatInputEntity__sensitivity',
|
|
24
|
+
text: 'fai-ChatInputEntity__text'
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Styles for the root slot
|
|
28
|
+
*/ const useStyles = (0, _reactcomponents.makeStyles)({
|
|
29
|
+
root: {},
|
|
30
|
+
text: {
|
|
31
|
+
color: _tokens.tokens.colorBrandForeground1
|
|
32
|
+
},
|
|
33
|
+
href: {
|
|
34
|
+
color: _tokens.tokens.colorBrandForegroundLink,
|
|
35
|
+
':hover': {
|
|
36
|
+
textDecorationLine: 'underline',
|
|
37
|
+
color: _tokens.tokens.colorBrandForegroundLinkHover
|
|
38
|
+
},
|
|
39
|
+
':active': {
|
|
40
|
+
textDecorationLine: 'underline',
|
|
41
|
+
color: _tokens.tokens.colorBrandForegroundLinkPressed
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
sensitivity: {
|
|
45
|
+
paddingLeft: _tokens.tokens.spacingHorizontalXXS
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const useChatInputEntityStyles_unstable = (state)=>{
|
|
49
|
+
'use no memo';
|
|
50
|
+
const styles = useStyles();
|
|
51
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(chatInputEntityClassNames.root, styles.root, state.root.className);
|
|
52
|
+
if (state.text) {
|
|
53
|
+
state.text.className = (0, _reactcomponents.mergeClasses)(chatInputEntityClassNames.text, styles.text, state.text.as === 'a' && styles.href, state.text.className);
|
|
54
|
+
}
|
|
55
|
+
if (state.sensitivity) {
|
|
56
|
+
state.sensitivity.className = (0, _reactcomponents.mergeClasses)(chatInputEntityClassNames.sensitivity, styles.sensitivity, state.sensitivity.className);
|
|
57
|
+
}
|
|
58
|
+
return state;
|
|
59
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useChatInputEntityStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { ChatInputEntitySlots, ChatInputEntityState } from './ChatInputEntity.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const chatInputEntityClassNames: SlotClassNames<ChatInputEntitySlots> = {\n root: 'fai-ChatInputEntity',\n sensitivity: 'fai-ChatInputEntity__sensitivity',\n text: 'fai-ChatInputEntity__text',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {},\n\n text: {\n color: tokens.colorBrandForeground1,\n },\n\n href: {\n color: tokens.colorBrandForegroundLink,\n\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkHover,\n },\n\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkPressed,\n },\n },\n sensitivity: {\n paddingLeft: tokens.spacingHorizontalXXS,\n },\n});\n\n/**\n * Apply styling to the ChatInputEntity slots based on the state\n */\nexport const useChatInputEntityStyles_unstable = (state: ChatInputEntityState): ChatInputEntityState => {\n 'use no memo';\n\n const styles = useStyles();\n\n state.root.className = mergeClasses(chatInputEntityClassNames.root, styles.root, state.root.className);\n\n if (state.text) {\n state.text.className = mergeClasses(\n chatInputEntityClassNames.text,\n styles.text,\n state.text.as === 'a' && styles.href,\n state.text.className,\n );\n }\n\n if (state.sensitivity) {\n state.sensitivity.className = mergeClasses(\n chatInputEntityClassNames.sensitivity,\n styles.sensitivity,\n state.sensitivity.className,\n );\n }\n\n return state;\n};\n"],"names":["chatInputEntityClassNames","useChatInputEntityStyles_unstable","root","sensitivity","text","useStyles","makeStyles","color","tokens","colorBrandForeground1","href","colorBrandForegroundLink","textDecorationLine","colorBrandForegroundLinkHover","colorBrandForegroundLinkPressed","paddingLeft","spacingHorizontalXXS","state","styles","className","mergeClasses","as"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,yBAAAA;eAAAA;;IAqCAC,iCAAAA;eAAAA;;;iCA1C4B;wBAClB;AAIhB,MAAMD,4BAAkE;IAC7EE,MAAM;IACNC,aAAa;IACbC,MAAM;AACR;AAEA;;CAEC,GACD,MAAMC,YAAYC,IAAAA,2BAAAA,EAAW;IAC3BJ,MAAM,CAAC;IAEPE,MAAM;QACJG,OAAOC,cAAAA,CAAOC,qBAAqB;IACrC;IAEAC,MAAM;QACJH,OAAOC,cAAAA,CAAOG,wBAAwB;QAEtC,UAAU;YACRC,oBAAoB;YACpBL,OAAOC,cAAAA,CAAOK,6BAA6B;QAC7C;QAEA,WAAW;YACTD,oBAAoB;YACpBL,OAAOC,cAAAA,CAAOM,+BAA+B;QAC/C;IACF;IACAX,aAAa;QACXY,aAAaP,cAAAA,CAAOQ,oBAAoB;IAC1C;AACF;AAKO,MAAMf,oCAAoC,CAACgB;IAChD;IAEA,MAAMC,SAASb;IAEfY,MAAMf,IAAI,CAACiB,SAAS,GAAGC,IAAAA,6BAAAA,EAAapB,0BAA0BE,IAAI,EAAEgB,OAAOhB,IAAI,EAAEe,MAAMf,IAAI,CAACiB,SAAS;IAErG,IAAIF,MAAMb,IAAI,EAAE;QACda,MAAMb,IAAI,CAACe,SAAS,GAAGC,IAAAA,6BAAAA,EACrBpB,0BAA0BI,IAAI,EAC9Bc,OAAOd,IAAI,EACXa,MAAMb,IAAI,CAACiB,EAAE,KAAK,OAAOH,OAAOR,IAAI,EACpCO,MAAMb,IAAI,CAACe,SAAS;IAExB;IAEA,IAAIF,MAAMd,WAAW,EAAE;QACrBc,MAAMd,WAAW,CAACgB,SAAS,GAAGC,IAAAA,6BAAAA,EAC5BpB,0BAA0BG,WAAW,EACrCe,OAAOf,WAAW,EAClBc,MAAMd,WAAW,CAACgB,SAAS;IAE/B;IAEA,OAAOF;AACT"}
|
|
@@ -18,4 +18,4 @@ const ChatInputToken = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
18
18
|
(0, _useChatInputTokenStylesstyles.useChatInputTokenStyles_unstable)(state);
|
|
19
19
|
return (0, _renderChatInputToken.renderChatInputToken_unstable)(state);
|
|
20
20
|
});
|
|
21
|
-
ChatInputToken.displayName = 'ChatInputToken';
|
|
21
|
+
ChatInputToken.displayName = 'ChatInputToken';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatInputToken.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useChatInputToken_unstable } from './useChatInputToken';\nimport { renderChatInputToken_unstable } from './renderChatInputToken';\nimport { useChatInputTokenStyles_unstable } from './useChatInputTokenStyles.styles';\nimport type { ChatInputTokenProps } from './ChatInputToken.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ChatInputToken component\nexport const ChatInputToken: ForwardRefComponent<ChatInputTokenProps> = React.forwardRef((props, ref) => {\n const state = useChatInputToken_unstable(props, ref);\n\n useChatInputTokenStyles_unstable(state);\n return renderChatInputToken_unstable(state);\n});\n\nChatInputToken.displayName = 'ChatInputToken';\n"],"names":["ChatInputToken","React","forwardRef","props","state","useChatInputToken_unstable","useChatInputTokenStyles_unstable","renderChatInputToken_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;mCACoB;sCACG;+CACG;AAK1C,MAAMA,iBAAAA,WAAAA,
|
|
1
|
+
{"version":3,"sources":["ChatInputToken.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useChatInputToken_unstable } from './useChatInputToken';\nimport { renderChatInputToken_unstable } from './renderChatInputToken';\nimport { useChatInputTokenStyles_unstable } from './useChatInputTokenStyles.styles';\nimport type { ChatInputTokenProps } from './ChatInputToken.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ChatInputToken component\nexport const ChatInputToken: ForwardRefComponent<ChatInputTokenProps> = React.forwardRef((props, ref) => {\n const state = useChatInputToken_unstable(props, ref);\n\n useChatInputTokenStyles_unstable(state);\n return renderChatInputToken_unstable(state);\n});\n\nChatInputToken.displayName = 'ChatInputToken';\n"],"names":["ChatInputToken","React","forwardRef","props","ref","state","useChatInputToken_unstable","useChatInputTokenStyles_unstable","renderChatInputToken_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;mCACoB;sCACG;+CACG;AAK1C,MAAMA,iBAAAA,WAAAA,GAA2DC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQC,IAAAA,6CAAAA,EAA2BH,OAAOC;IAEhDG,IAAAA,+DAAAA,EAAiCF;IACjC,OAAOG,IAAAA,mDAAAA,EAA8BH;AACvC;AAEAL,eAAeS,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatInputToken.node.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport type {\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n Spread,\n} from '@fluentui-copilot/text-editor';\nimport type { ChatInputTokenProps } from './ChatInputToken.types';\nimport { ChatInputToken } from './ChatInputToken';\n\nexport type SerializedChatInputTokenNode = Spread<\n { text: string; componentProps?: ChatInputTokenProps },\n SerializedLexicalNode\n>;\n\nexport class ChatInputTokenNode extends DecoratorNode<JSX.Element | null> {\n __text: string;\n __componentProps?: ChatInputTokenProps;\n\n static getType(): string {\n return 'token';\n }\n static clone(node: ChatInputTokenNode): ChatInputTokenNode {\n return new ChatInputTokenNode(node.__text, node.__componentProps, node.__key);\n }\n\n static importJSON(serializedNode: SerializedChatInputTokenNode): ChatInputTokenNode {\n return $createChatInputTokenNode(serializedNode.text, serializedNode.componentProps);\n }\n\n isIsolated() {\n return true;\n }\n isInline() {\n return true;\n }\n\n getTextContent(): string {\n return this.__text;\n }\n\n exportJSON(): SerializedChatInputTokenNode {\n return {\n text: this.__text,\n componentProps: this.__componentProps,\n type: ChatInputTokenNode.getType(),\n version: 1,\n };\n }\n\n constructor(text: string, componentProps?: ChatInputTokenProps, key?: NodeKey) {\n super(key);\n this.__text = text;\n this.__componentProps = componentProps;\n }\n\n createDOM(): HTMLElement {\n // eslint-disable-next-line no-restricted-globals\n return document.createElement('span');\n }\n\n updateDOM() {\n return false;\n }\n\n decorate(_editor: LexicalEditor, config: EditorConfig): JSX.Element | null {\n if (this.__componentProps?.children) {\n return <ChatInputToken {...this.__componentProps} />;\n }\n return <ChatInputToken {...this.__componentProps}>{this.__text}</ChatInputToken>;\n }\n}\n\nexport function $createChatInputTokenNode(\n text: string,\n componentProps?: ChatInputTokenProps,\n key?: NodeKey,\n): ChatInputTokenNode {\n return new ChatInputTokenNode(text, componentProps, key);\n}\n\nexport function $isChatInputTokenNode(node: LexicalNode | null | undefined): node is ChatInputTokenNode {\n return node instanceof ChatInputTokenNode;\n}\n"],"names":["$createChatInputTokenNode","$isChatInputTokenNode","ChatInputTokenNode","DecoratorNode","getType","clone","node","__text","__componentProps","__key","importJSON","serializedNode","text","componentProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","_this___componentProps","children","React","ChatInputToken","constructor","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA6EgBA,yBAAAA;eAAAA;;IAQAC,qBAAAA;eAAAA;;IAlEHC,kBAAAA;eAAAA;;;;;iEAnBU;4BAEO;gCAUC;AAOxB,MAAMA,2BAA2BC,yBAAAA;
|
|
1
|
+
{"version":3,"sources":["ChatInputToken.node.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport type {\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n Spread,\n} from '@fluentui-copilot/text-editor';\nimport type { ChatInputTokenProps } from './ChatInputToken.types';\nimport { ChatInputToken } from './ChatInputToken';\n\nexport type SerializedChatInputTokenNode = Spread<\n { text: string; componentProps?: ChatInputTokenProps },\n SerializedLexicalNode\n>;\n\nexport class ChatInputTokenNode extends DecoratorNode<JSX.Element | null> {\n __text: string;\n __componentProps?: ChatInputTokenProps;\n\n static getType(): string {\n return 'token';\n }\n static clone(node: ChatInputTokenNode): ChatInputTokenNode {\n return new ChatInputTokenNode(node.__text, node.__componentProps, node.__key);\n }\n\n static importJSON(serializedNode: SerializedChatInputTokenNode): ChatInputTokenNode {\n return $createChatInputTokenNode(serializedNode.text, serializedNode.componentProps);\n }\n\n isIsolated() {\n return true;\n }\n isInline() {\n return true;\n }\n\n getTextContent(): string {\n return this.__text;\n }\n\n exportJSON(): SerializedChatInputTokenNode {\n return {\n text: this.__text,\n componentProps: this.__componentProps,\n type: ChatInputTokenNode.getType(),\n version: 1,\n };\n }\n\n constructor(text: string, componentProps?: ChatInputTokenProps, key?: NodeKey) {\n super(key);\n this.__text = text;\n this.__componentProps = componentProps;\n }\n\n createDOM(): HTMLElement {\n // eslint-disable-next-line no-restricted-globals\n return document.createElement('span');\n }\n\n updateDOM() {\n return false;\n }\n\n decorate(_editor: LexicalEditor, config: EditorConfig): JSX.Element | null {\n if (this.__componentProps?.children) {\n return <ChatInputToken {...this.__componentProps} />;\n }\n return <ChatInputToken {...this.__componentProps}>{this.__text}</ChatInputToken>;\n }\n}\n\nexport function $createChatInputTokenNode(\n text: string,\n componentProps?: ChatInputTokenProps,\n key?: NodeKey,\n): ChatInputTokenNode {\n return new ChatInputTokenNode(text, componentProps, key);\n}\n\nexport function $isChatInputTokenNode(node: LexicalNode | null | undefined): node is ChatInputTokenNode {\n return node instanceof ChatInputTokenNode;\n}\n"],"names":["$createChatInputTokenNode","$isChatInputTokenNode","ChatInputTokenNode","DecoratorNode","getType","clone","node","__text","__componentProps","__key","importJSON","serializedNode","text","componentProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","_this___componentProps","children","React","ChatInputToken","constructor","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA6EgBA,yBAAAA;eAAAA;;IAQAC,qBAAAA;eAAAA;;IAlEHC,kBAAAA;eAAAA;;;;;iEAnBU;4BAEO;gCAUC;AAOxB,MAAMA,2BAA2BC,yBAAAA;IAItC,OAAOC,UAAkB;QACvB,OAAO;IACT;IACA,OAAOC,MAAMC,IAAwB,EAAsB;QACzD,OAAO,IAAIJ,mBAAmBI,KAAKC,MAAM,EAAED,KAAKE,gBAAgB,EAAEF,KAAKG,KAAK;IAC9E;IAEA,OAAOC,WAAWC,cAA4C,EAAsB;QAClF,OAAOX,0BAA0BW,eAAeC,IAAI,EAAED,eAAeE,cAAc;IACrF;IAEAC,aAAa;QACX,OAAO;IACT;IACAC,WAAW;QACT,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAACT,MAAM;IACpB;IAEAU,aAA2C;QACzC,OAAO;YACLL,MAAM,IAAI,CAACL,MAAM;YACjBM,gBAAgB,IAAI,CAACL,gBAAgB;YACrCU,MAAMhB,mBAAmBE,OAAO;YAChCe,SAAS;QACX;IACF;IAQAC,YAAyB;QACvB,iDAAiD;QACjD,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEAC,YAAY;QACV,OAAO;IACT;IAEAC,SAASC,OAAsB,EAAEC,MAAoB,EAAsB;YACrEC;QAAJ,IAAA,AAAIA,CAAAA,yBAAA,IAAI,CAACnB,gBAAgB,AAAhBA,MAAgB,QAArBmB,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAuBC,QAAQ,EAAE;YACnC,OAAA,WAAA,GAAOC,OAAAP,aAAA,CAACQ,8BAAAA,EAAmB,IAAI,CAACtB,gBAAgB;QAClD;QACA,OAAA,WAAA,GAAOqB,OAAAP,aAAA,CAACQ,8BAAAA,EAAmB,IAAI,CAACtB,gBAAgB,EAAG,IAAI,CAACD,MAAM;IAChE;IApBAwB,YAAYnB,IAAY,EAAEC,cAAoC,EAAEmB,GAAa,CAAE;QAC7E,KAAK,CAACA;QAnCRzB,IAAAA,kBAAAA,EAAAA,IAAAA,EAAAA,UAAAA,KAAAA;QACAC,IAAAA,kBAAAA,EAAAA,IAAAA,EAAAA,oBAAAA,KAAAA;QAmCE,IAAI,CAACD,MAAM,GAAGK;QACd,IAAI,CAACJ,gBAAgB,GAAGK;IAC1B;AAiBF;AAEO,SAASb,0BACdY,IAAY,EACZC,cAAoC,EACpCmB,GAAa;IAEb,OAAO,IAAI9B,mBAAmBU,MAAMC,gBAAgBmB;AACtD;AAEO,SAAS/B,sBAAsBK,IAAoC;IACxE,OAAOA,gBAAgBJ;AACzB"}
|
|
@@ -39,4 +39,3 @@ const _renderChatInputToken = require("./renderChatInputToken");
|
|
|
39
39
|
const _useChatInputToken = require("./useChatInputToken");
|
|
40
40
|
const _useChatInputTokenStylesstyles = require("./useChatInputTokenStyles.styles");
|
|
41
41
|
const _ChatInputTokennode = require("./ChatInputToken.node");
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -13,4 +13,4 @@ const _reactcomponents = require("@fluentui/react-components");
|
|
|
13
13
|
const renderChatInputToken_unstable = (state)=>{
|
|
14
14
|
(0, _reactcomponents.assertSlots)(state);
|
|
15
15
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
|
|
16
|
-
};
|
|
16
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderChatInputToken.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { ChatInputTokenState, ChatInputTokenSlots } from './ChatInputToken.types';\n\n/**\n * Render the final JSX of ChatInputToken\n */\nexport const renderChatInputToken_unstable = (state: ChatInputTokenState) => {\n assertSlots<ChatInputTokenSlots>(state);\n\n return <state.root />;\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["renderChatInputToken.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { ChatInputTokenState, ChatInputTokenSlots } from './ChatInputToken.types';\n\n/**\n * Render the final JSX of ChatInputToken\n */\nexport const renderChatInputToken_unstable = (state: ChatInputTokenState) => {\n assertSlots<ChatInputTokenSlots>(state);\n\n return <state.root />;\n};\n"],"names":["renderChatInputToken_unstable","state","assertSlots","_jsx","root"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;iCAE4B;AAMrB,MAAMA,gCAAgC,CAACC;IAC5CC,IAAAA,4BAAAA,EAAiCD;IAEjC,OAAA,WAAA,GAAOE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA,CAAA;AACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useChatInputToken.ts"],"sourcesContent":["import type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { ChatInputTokenProps, ChatInputTokenState } from './ChatInputToken.types';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\n\n/**\n * Create the state required to render ChatInputToken.\n *\n * The returned state can be modified with hooks such as useChatInputTokenStyles_unstable,\n * before being passed to renderChatInputToken_unstable.\n *\n * @param props - props from this instance of ChatInputToken\n * @param ref - reference to root HTMLElement of ChatInputToken\n */\nexport const useChatInputToken_unstable = (\n props: ChatInputTokenProps,\n ref: React.Ref<HTMLElement>,\n): ChatInputTokenState => {\n return {\n components: {\n root: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('span', {\n ref,\n ...props,\n }),\n { elementType: 'span' },\n ),\n };\n};\n"],"names":["useChatInputToken_unstable","props","ref","components","root"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["useChatInputToken.ts"],"sourcesContent":["import type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { ChatInputTokenProps, ChatInputTokenState } from './ChatInputToken.types';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\n\n/**\n * Create the state required to render ChatInputToken.\n *\n * The returned state can be modified with hooks such as useChatInputTokenStyles_unstable,\n * before being passed to renderChatInputToken_unstable.\n *\n * @param props - props from this instance of ChatInputToken\n * @param ref - reference to root HTMLElement of ChatInputToken\n */\nexport const useChatInputToken_unstable = (\n props: ChatInputTokenProps,\n ref: React.Ref<HTMLElement>,\n): ChatInputTokenState => {\n return {\n components: {\n root: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('span', {\n ref,\n ...props,\n }),\n { elementType: 'span' },\n ),\n };\n};\n"],"names":["useChatInputToken_unstable","props","ref","components","root","slot","always","getIntrinsicElementProps","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;iCAdkC;AAcxC,MAAMA,6BAA6B,CACxCC,OACAC;IAEA,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAMC,qBAAAA,CAAKC,MAAM,CACfC,IAAAA,yCAAAA,EAAyB,QAAQ;YAC/BL;YACA,GAAGD,KAAK;QACV,IACA;YAAEO,aAAa;QAAO;IAE1B;AACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
chatInputTokenClassNames: function() {
|
|
13
|
+
return chatInputTokenClassNames;
|
|
14
|
+
},
|
|
15
|
+
useChatInputTokenStyles_unstable: function() {
|
|
16
|
+
return useChatInputTokenStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _tokens = require("@fluentui-copilot/tokens");
|
|
21
|
+
const chatInputTokenClassNames = {
|
|
22
|
+
root: 'fai-ChatInputToken'
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Styles for the root slot
|
|
26
|
+
*/ const useBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
27
|
+
..._tokens.typographyStyles.caption1,
|
|
28
|
+
lineHeight: `calc(${_tokens.tokens.lineHeightBase200} + (2 * ${_tokens.tokens.spacingVerticalXXS}) + (2 * ${_tokens.tokens.strokeWidthThin}))`,
|
|
29
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3,
|
|
30
|
+
border: `${_tokens.tokens.strokeWidthThin} solid ${_tokens.tokens.colorTransparentStroke}`,
|
|
31
|
+
borderRadius: _tokens.tokens.borderRadiusMedium,
|
|
32
|
+
boxDecorationBreak: 'clone',
|
|
33
|
+
color: _tokens.tokens.colorNeutralForeground2,
|
|
34
|
+
padding: `${_tokens.tokens.spacingVerticalXXS} 0`
|
|
35
|
+
});
|
|
36
|
+
const useChatInputTokenStyles_unstable = (state)=>{
|
|
37
|
+
'use no memo';
|
|
38
|
+
const baseClassName = useBaseClassName();
|
|
39
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(chatInputTokenClassNames.root, baseClassName, state.root.className);
|
|
40
|
+
return state;
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useChatInputTokenStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport type { ChatInputTokenSlots, ChatInputTokenState } from './ChatInputToken.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const chatInputTokenClassNames: SlotClassNames<ChatInputTokenSlots> = {\n root: 'fai-ChatInputToken',\n};\n\n/**\n * Styles for the root slot\n */\nconst useBaseClassName = makeResetStyles({\n ...typographyStyles.caption1,\n lineHeight: `calc(${tokens.lineHeightBase200} + (2 * ${tokens.spacingVerticalXXS}) + (2 * ${tokens.strokeWidthThin}))`,\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n borderRadius: tokens.borderRadiusMedium,\n boxDecorationBreak: 'clone',\n color: tokens.colorNeutralForeground2,\n padding: `${tokens.spacingVerticalXXS} 0`,\n});\n\n/**\n * Apply styling to the ChatInputToken slots based on the state\n */\nexport const useChatInputTokenStyles_unstable = (state: ChatInputTokenState): ChatInputTokenState => {\n 'use no memo';\n\n const baseClassName = useBaseClassName();\n state.root.className = mergeClasses(chatInputTokenClassNames.root, baseClassName, state.root.className);\n\n return state;\n};\n"],"names":["chatInputTokenClassNames","useChatInputTokenStyles_unstable","root","useBaseClassName","makeResetStyles","typographyStyles","caption1","lineHeight","tokens","lineHeightBase200","spacingVerticalXXS","strokeWidthThin","backgroundColor","colorNeutralBackground3","border","colorTransparentStroke","borderRadius","borderRadiusMedium","boxDecorationBreak","color","colorNeutralForeground2","padding","state","baseClassName","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,wBAAAA;eAAAA;;IAqBAC,gCAAAA;eAAAA;;;iCA1BiC;wBACL;AAIlC,MAAMD,2BAAgE;IAC3EE,MAAM;AACR;AAEA;;CAEC,GACD,MAAMC,mBAAmBC,IAAAA,gCAAAA,EAAgB;IACvC,GAAGC,wBAAAA,CAAiBC,QAAQ;IAC5BC,YAAY,CAAC,KAAK,EAAEC,cAAAA,CAAOC,iBAAiB,CAAC,QAAQ,EAAED,cAAAA,CAAOE,kBAAkB,CAAC,SAAS,EAAEF,cAAAA,CAAOG,eAAe,CAAC,EAAE,CAAC;IACtHC,iBAAiBJ,cAAAA,CAAOK,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEN,cAAAA,CAAOG,eAAe,CAAC,OAAO,EAAEH,cAAAA,CAAOO,sBAAsB,CAAC,CAAC;IAC1EC,cAAcR,cAAAA,CAAOS,kBAAkB;IACvCC,oBAAoB;IACpBC,OAAOX,cAAAA,CAAOY,uBAAuB;IACrCC,SAAS,CAAC,EAAEb,cAAAA,CAAOE,kBAAkB,CAAC,EAAE,CAAC;AAC3C;AAKO,MAAMT,mCAAmC,CAACqB;IAC/C;IAEA,MAAMC,gBAAgBpB;IACtBmB,MAAMpB,IAAI,CAACsB,SAAS,GAAGC,IAAAA,6BAAAA,EAAazB,yBAAyBE,IAAI,EAAEqB,eAAeD,MAAMpB,IAAI,CAACsB,SAAS;IAEtG,OAAOF;AACT"}
|
|
@@ -18,4 +18,4 @@ const GhostText = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
18
18
|
(0, _useGhostTextStylesstyles.useGhostTextStyles_unstable)(state);
|
|
19
19
|
return (0, _renderGhostText.renderGhostText_unstable)(state);
|
|
20
20
|
});
|
|
21
|
-
GhostText.displayName = 'GhostText';
|
|
21
|
+
GhostText.displayName = 'GhostText';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["GhostText.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGhostText_unstable } from './useGhostText';\nimport { renderGhostText_unstable } from './renderGhostText';\nimport { useGhostTextStyles_unstable } from './useGhostTextStyles.styles';\nimport type { GhostTextProps } from './GhostText.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// GhostText component - TODO: add more docs\nexport const GhostText: ForwardRefComponent<GhostTextProps> = React.forwardRef((props, ref) => {\n const state = useGhostText_unstable(props, ref);\n\n useGhostTextStyles_unstable(state);\n return renderGhostText_unstable(state);\n});\n\nGhostText.displayName = 'GhostText';\n"],"names":["GhostText","React","forwardRef","props","state","useGhostText_unstable","useGhostTextStyles_unstable","renderGhostText_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;8BACe;iCACG;0CACG;AAKrC,MAAMA,YAAAA,WAAAA,
|
|
1
|
+
{"version":3,"sources":["GhostText.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGhostText_unstable } from './useGhostText';\nimport { renderGhostText_unstable } from './renderGhostText';\nimport { useGhostTextStyles_unstable } from './useGhostTextStyles.styles';\nimport type { GhostTextProps } from './GhostText.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// GhostText component - TODO: add more docs\nexport const GhostText: ForwardRefComponent<GhostTextProps> = React.forwardRef((props, ref) => {\n const state = useGhostText_unstable(props, ref);\n\n useGhostTextStyles_unstable(state);\n return renderGhostText_unstable(state);\n});\n\nGhostText.displayName = 'GhostText';\n"],"names":["GhostText","React","forwardRef","props","ref","state","useGhostText_unstable","useGhostTextStyles_unstable","renderGhostText_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;8BACe;iCACG;0CACG;AAKrC,MAAMA,YAAAA,WAAAA,GAAiDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQC,IAAAA,mCAAAA,EAAsBH,OAAOC;IAE3CG,IAAAA,qDAAAA,EAA4BF;IAC5B,OAAOG,IAAAA,yCAAAA,EAAyBH;AAClC;AAEAL,UAAUS,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["GhostText.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type GhostTextSlots = {\n root: Slot<'span'>;\n indicator?: Slot<'span'>;\n};\n\n/**\n * GhostText Props\n */\nexport type GhostTextProps = ComponentProps<GhostTextSlots> & { nodeKey?: string };\n\n/**\n * State used in rendering GhostText\n */\nexport type GhostTextState = ComponentState<GhostTextSlots>;\n// TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from GhostTextProps.\n// & Required<Pick<GhostTextProps, 'propName'>>\n"],"names":[],"rangeMappings":";;;;;;;","mappings":"AAYA;;CAEC;;;;
|
|
1
|
+
{"version":3,"sources":["GhostText.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type GhostTextSlots = {\n root: Slot<'span'>;\n indicator?: Slot<'span'>;\n};\n\n/**\n * GhostText Props\n */\nexport type GhostTextProps = ComponentProps<GhostTextSlots> & { nodeKey?: string };\n\n/**\n * State used in rendering GhostText\n */\nexport type GhostTextState = ComponentState<GhostTextSlots>;\n// TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from GhostTextProps.\n// & Required<Pick<GhostTextProps, 'propName'>>\n"],"names":[],"rangeMappings":";;;;;;;","mappings":"AAYA;;CAEC;;;;CAED,0HAA0H;CAC1H,+CAA+C"}
|