@fluentui-copilot/react-chat-input-plugins 0.0.3 → 0.0.5
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 +55 -1
- package/CHANGELOG.md +24 -2
- package/dist/index.d.ts +4 -1
- package/lib/BasicFunctionality.js.map +1 -1
- package/lib/ChatInputEntity.js.map +1 -1
- package/lib/ChatInputToken.js.map +1 -1
- package/lib/GhostText.js.map +1 -1
- package/lib/ImperativeControl.js.map +1 -1
- package/lib/components/ChatInputEntity/ChatInputEntity.js.map +1 -1
- package/lib/components/ChatInputEntity/ChatInputEntity.types.js +3 -1
- package/lib/components/ChatInputEntity/ChatInputEntity.types.js.map +1 -1
- package/lib/components/ChatInputEntity/index.js.map +1 -1
- package/lib/components/ChatInputEntity/renderChatInputEntity.js.map +1 -1
- package/lib/components/ChatInputEntity/useChatInputEntity.js.map +1 -1
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.js.map +1 -1
- package/lib/components/ChatInputToken/ChatInputToken.js.map +1 -1
- package/lib/components/ChatInputToken/ChatInputToken.node.js.map +1 -1
- package/lib/components/ChatInputToken/ChatInputToken.types.js +3 -1
- package/lib/components/ChatInputToken/ChatInputToken.types.js.map +1 -1
- package/lib/components/ChatInputToken/index.js.map +1 -1
- package/lib/components/ChatInputToken/renderChatInputToken.js.map +1 -1
- package/lib/components/ChatInputToken/useChatInputToken.js.map +1 -1
- package/lib/components/ChatInputToken/useChatInputTokenStyles.js +2 -2
- package/lib/components/ChatInputToken/useChatInputTokenStyles.js.map +1 -1
- package/lib/components/GhostText/GhostText.js.map +1 -1
- package/lib/components/GhostText/GhostText.types.js +3 -1
- package/lib/components/GhostText/GhostText.types.js.map +1 -1
- package/lib/components/GhostText/index.js.map +1 -1
- package/lib/components/GhostText/renderGhostText.js.map +1 -1
- package/lib/components/GhostText/useGhostText.js +26 -3
- package/lib/components/GhostText/useGhostText.js.map +1 -1
- package/lib/components/GhostText/useGhostTextStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js +12 -1
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
- package/lib/plugins/BasicFunctionality/index.js.map +1 -1
- package/lib/plugins/ChatInputEntity/ChatInputEntity.node.js.map +1 -1
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.js.map +1 -1
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js.map +1 -1
- package/lib/plugins/ChatInputEntity/index.js.map +1 -1
- package/lib/plugins/GhostText/GhostText.js.map +1 -1
- package/lib/plugins/GhostText/GhostText.node.js +4 -1
- package/lib/plugins/GhostText/GhostText.node.js.map +1 -1
- package/lib/plugins/GhostText/index.js.map +1 -1
- package/lib/plugins/ImperativeControl/ImperativeControl.js.map +1 -1
- package/lib/plugins/ImperativeControl/index.js.map +1 -1
- package/lib/plugins/ManualGhostText/ManualGhostText.js.map +1 -1
- package/lib/plugins/ManualGhostText/index.js.map +1 -1
- package/lib-commonjs/BasicFunctionality.js.map +1 -1
- package/lib-commonjs/ChatInputEntity.js.map +1 -1
- package/lib-commonjs/ChatInputToken.js.map +1 -1
- package/lib-commonjs/GhostText.js.map +1 -1
- package/lib-commonjs/ImperativeControl.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js +3 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/index.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js +3 -3
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.types.js +3 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.types.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/index.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.js +3 -4
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.js.map +1 -1
- package/lib-commonjs/components/GhostText/GhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/GhostText.types.js +3 -1
- package/lib-commonjs/components/GhostText/GhostText.types.js.map +1 -1
- package/lib-commonjs/components/GhostText/index.js.map +1 -1
- package/lib-commonjs/components/GhostText/renderGhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/useGhostText.js +25 -2
- package/lib-commonjs/components/GhostText/useGhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/useGhostTextStyles.js.map +1 -1
- package/lib-commonjs/index.js +46 -46
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js +14 -1
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
- package/lib-commonjs/plugins/BasicFunctionality/index.js.map +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js +3 -3
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js.map +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js.map +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js.map +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/index.js.map +1 -1
- package/lib-commonjs/plugins/GhostText/GhostText.js.map +1 -1
- package/lib-commonjs/plugins/GhostText/GhostText.node.js +7 -4
- package/lib-commonjs/plugins/GhostText/GhostText.node.js.map +1 -1
- package/lib-commonjs/plugins/GhostText/index.js.map +1 -1
- package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js.map +1 -1
- package/lib-commonjs/plugins/ImperativeControl/index.js.map +1 -1
- package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js.map +1 -1
- package/lib-commonjs/plugins/ManualGhostText/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,61 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-chat-input-plugins",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 08 May 2024 22:09:00 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-chat-input-plugins_v0.0.5",
|
|
7
|
+
"version": "0.0.5",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "sarah.higley@microsoft.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-chat-input-plugins",
|
|
13
|
+
"commit": "44f1da0736caf911d7d9f2d7a30b4e983a5a8b2e",
|
|
14
|
+
"comment": "chore: bump @fluentui/react-components to latest, 9.49.2"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "tristan.watanabe@gmail.com",
|
|
18
|
+
"package": "@fluentui-copilot/react-chat-input-plugins",
|
|
19
|
+
"commit": "7a6455002d0034273026cb63a31a77a365e78b8d",
|
|
20
|
+
"comment": "fix: remove horizontal padding from ChatInputToken."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "owcampbe@microsoft.com",
|
|
24
|
+
"package": "@fluentui-copilot/react-chat-input-plugins",
|
|
25
|
+
"commit": "8b3fa1f2bc2732776130769a904a98c314207fef",
|
|
26
|
+
"comment": "fix: Improve navigation around GhostText."
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"date": "Tue, 30 Apr 2024 20:55:42 GMT",
|
|
33
|
+
"tag": "@fluentui-copilot/react-chat-input-plugins_v0.0.4",
|
|
34
|
+
"version": "0.0.4",
|
|
35
|
+
"comments": {
|
|
36
|
+
"patch": [
|
|
37
|
+
{
|
|
38
|
+
"author": "owcampbe@microsoft.com",
|
|
39
|
+
"package": "@fluentui-copilot/react-chat-input-plugins",
|
|
40
|
+
"commit": "89238fe9540ab648e5e7589d0c0733d2bf07c844",
|
|
41
|
+
"comment": "fix: Adjust ChatInputToken styles."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"author": "owcampbe@microsoft.com",
|
|
45
|
+
"package": "@fluentui-copilot/react-chat-input-plugins",
|
|
46
|
+
"commit": "f2067016fa67e0718cb2c309338ab4376d256cd4",
|
|
47
|
+
"comment": "chore: Hook up onPaste to plugin core."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "sarah.higley@microsoft.com",
|
|
51
|
+
"package": "@fluentui-copilot/react-chat-input-plugins",
|
|
52
|
+
"commit": "66eba4eb0956384ecc14b2a40c5fa722680f79d8",
|
|
53
|
+
"comment": "chore: bump @fluentui/react-components to latest, 9.49.0"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"date": "Thu, 18 Apr 2024 00:28:05 GMT",
|
|
6
60
|
"tag": "@fluentui-copilot/react-chat-input-plugins_v0.0.3",
|
|
7
61
|
"version": "0.0.3",
|
|
8
62
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-chat-input-plugins
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 08 May 2024 22:09:00 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.0.5](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.0.5)
|
|
8
|
+
|
|
9
|
+
Wed, 08 May 2024 22:09:00 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-chat-input-plugins_v0.0.4..@fluentui-copilot/react-chat-input-plugins_v0.0.5)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- chore: bump @fluentui/react-components to latest, 9.49.2 ([PR #1614](https://github.com/microsoft/fluentai/pull/1614) by sarah.higley@microsoft.com)
|
|
15
|
+
- fix: remove horizontal padding from ChatInputToken. ([PR #1604](https://github.com/microsoft/fluentai/pull/1604) by tristan.watanabe@gmail.com)
|
|
16
|
+
- fix: Improve navigation around GhostText. ([PR #1611](https://github.com/microsoft/fluentai/pull/1611) by owcampbe@microsoft.com)
|
|
17
|
+
|
|
18
|
+
## [0.0.4](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.0.4)
|
|
19
|
+
|
|
20
|
+
Tue, 30 Apr 2024 20:55:42 GMT
|
|
21
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-chat-input-plugins_v0.0.3..@fluentui-copilot/react-chat-input-plugins_v0.0.4)
|
|
22
|
+
|
|
23
|
+
### Patches
|
|
24
|
+
|
|
25
|
+
- fix: Adjust ChatInputToken styles. ([PR #1578](https://github.com/microsoft/fluentai/pull/1578) by owcampbe@microsoft.com)
|
|
26
|
+
- chore: Hook up onPaste to plugin core. ([PR #1556](https://github.com/microsoft/fluentai/pull/1556) by owcampbe@microsoft.com)
|
|
27
|
+
- chore: bump @fluentui/react-components to latest, 9.49.0 ([PR #1580](https://github.com/microsoft/fluentai/pull/1580) by sarah.higley@microsoft.com)
|
|
28
|
+
|
|
7
29
|
## [0.0.3](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.0.3)
|
|
8
30
|
|
|
9
|
-
Thu, 18 Apr 2024 00:
|
|
31
|
+
Thu, 18 Apr 2024 00:28:05 GMT
|
|
10
32
|
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-chat-input-plugins_v0.0.2..@fluentui-copilot/react-chat-input-plugins_v0.0.3)
|
|
11
33
|
|
|
12
34
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export declare type BasicFunctionalityPluginProps = {
|
|
|
32
32
|
trimWhitespace?: boolean;
|
|
33
33
|
onCountChanged?: (count: number) => void;
|
|
34
34
|
onContentChange?: (value: string) => void;
|
|
35
|
+
onPaste?: (event: ClipboardEvent) => void;
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
export declare type BasicFunctionalityPluginRef = {
|
|
@@ -171,7 +172,9 @@ export declare type GhostTextPluginProps = {
|
|
|
171
172
|
/**
|
|
172
173
|
* GhostText Props
|
|
173
174
|
*/
|
|
174
|
-
export declare type GhostTextProps = ComponentProps<GhostTextSlots> & {
|
|
175
|
+
export declare type GhostTextProps = ComponentProps<GhostTextSlots> & {
|
|
176
|
+
nodeKey?: string;
|
|
177
|
+
};
|
|
175
178
|
|
|
176
179
|
export declare type GhostTextSlots = {
|
|
177
180
|
root: Slot<'span'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["export * from './plugins/BasicFunctionality/index';\n"],"names":[],"mappings":"AAAA,cAAc,qCAAqC"}
|
|
1
|
+
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["export * from './plugins/BasicFunctionality/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,qCAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatInputEntity.ts"],"sourcesContent":["export * from './components/ChatInputEntity/index';\nexport * from './plugins/ChatInputEntity/index';\n"],"names":[],"mappings":"AAAA,cAAc,qCAAqC;AACnD,cAAc,kCAAkC"}
|
|
1
|
+
{"version":3,"sources":["ChatInputEntity.ts"],"sourcesContent":["export * from './components/ChatInputEntity/index';\nexport * from './plugins/ChatInputEntity/index';\n"],"names":[],"rangeMappings":";","mappings":"AAAA,cAAc,qCAAqC;AACnD,cAAc,kCAAkC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatInputToken.ts"],"sourcesContent":["export * from './components/ChatInputToken/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
|
|
1
|
+
{"version":3,"sources":["ChatInputToken.ts"],"sourcesContent":["export * from './components/ChatInputToken/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,oCAAoC"}
|
package/lib/GhostText.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["GhostText.ts"],"sourcesContent":["export * from './components/GhostText/index';\nexport * from './plugins/GhostText/index';\nexport * from './plugins/ManualGhostText/index';\n"],"names":[],"mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,4BAA4B;AAC1C,cAAc,kCAAkC"}
|
|
1
|
+
{"version":3,"sources":["GhostText.ts"],"sourcesContent":["export * from './components/GhostText/index';\nexport * from './plugins/GhostText/index';\nexport * from './plugins/ManualGhostText/index';\n"],"names":[],"rangeMappings":";;","mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,4BAA4B;AAC1C,cAAc,kCAAkC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ImperativeControl.ts"],"sourcesContent":["export * from './plugins/ImperativeControl/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
|
|
1
|
+
{"version":3,"sources":["ImperativeControl.ts"],"sourcesContent":["export * from './plugins/ImperativeControl/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,oCAAoC"}
|
|
@@ -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';\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":["React","useChatInputEntity_unstable","renderChatInputEntity_unstable","useChatInputEntityStyles_unstable","ChatInputEntity","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SAASC,iCAAiC,QAAQ,6BAA6B;AAI/E,kDAAkD;AAClD,OAAO,MAAMC,gCAA6DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQP,4BAA4BK,OAAOC;IAEjDJ,kCAAkCK;IAClC,OAAON,+BAA+BM;AACxC,GAAG;AAEHJ,gBAAgBK,WAAW,GAAG"}
|
|
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';\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":["React","useChatInputEntity_unstable","renderChatInputEntity_unstable","useChatInputEntityStyles_unstable","ChatInputEntity","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SAASC,iCAAiC,QAAQ,6BAA6B;AAI/E,kDAAkD;AAClD,OAAO,MAAMC,gCAA6DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQP,4BAA4BK,OAAOC;IAEjDJ,kCAAkCK;IAClC,OAAON,+BAA+BM;AACxC,GAAG;AAEHJ,gBAAgBK,WAAW,GAAG"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* State used in rendering ChatInputEntity
|
|
3
|
+
*/export {}; // TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from ChatInputEntityProps.
|
|
2
4
|
// & Required<Pick<ChatInputEntityProps, 'propName'>>
|
|
3
5
|
//# 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":[],"mappings":"
|
|
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,GACD,WAAwE,CACxE,gIAAgI;CAChI,qDAAqD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ChatInputEntity';\nexport * from './ChatInputEntity.types';\nexport * from './renderChatInputEntity';\nexport * from './useChatInputEntity';\nexport * from './useChatInputEntityStyles';\n"],"names":[],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,0BAA0B;AACxC,cAAc,uBAAuB;AACrC,cAAc,6BAA6B"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ChatInputEntity';\nexport * from './ChatInputEntity.types';\nexport * from './renderChatInputEntity';\nexport * from './useChatInputEntity';\nexport * from './useChatInputEntityStyles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,0BAA0B;AACxC,cAAc,uBAAuB;AACrC,cAAc,6BAA6B"}
|
|
@@ -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 />\n {state.sensitivity && <state.sensitivity />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderChatInputEntity_unstable","state","root","text","sensitivity"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7CF,YAAkCE;IAElC,qBACE,MAACA,MAAMC,IAAI;;0BACT,KAACD,MAAME,IAAI;YACVF,MAAMG,WAAW,kBAAI,KAACH,MAAMG,WAAW;;;AAG9C,EAAE"}
|
|
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 />\n {state.sensitivity && <state.sensitivity />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderChatInputEntity_unstable","state","root","text","sensitivity"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7CF,YAAkCE;IAElC,qBACE,MAACA,MAAMC,IAAI;;0BACT,KAACD,MAAME,IAAI;YACVF,MAAMG,WAAW,kBAAI,KAACH,MAAMG,WAAW;;;AAG9C,EAAE"}
|
|
@@ -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":["getPartitionedNativeProps","slot","useChatInputEntity_unstable","props","ref","as","elementType","nativeProps","primarySlotTagName","defaultTextSlotProps","target","rel","tabIndex","primary","components","root","sensitivity","text","always","defaultProps","optional","renderByDefault"],"mappings":"AACA,SAASA,yBAAyB,EAAEC,IAAI,QAAQ,6BAA6B;AAG7E,uEAAuE;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,EAAE,EAAE,GAAGF;IAEf,MAAMG,cAAcD,eAAAA,gBAAAA,KAAM;IAE1B,MAAME,cAAcP,0BAA0B;QAAEG;QAAOK,oBAAoBF;IAAY;IAEvF,MAAMG,uBACJH,gBAAgB,MACZ;QACEI,QAAQ;QACRC,KAAK;QACL,wEAAwE;QACxEC,UAAU,CAAC;QACX,GAAGL,YAAYM,OAAO;QACtBR,IAAI;QACJ,0GAA0G;QAC1GD,KAAKA;IACP,IACA;QAAE,GAAGG,YAAYM,OAAO;QAAER,IAAI;QAAiBD;IAAI;IAEzD,OAAO;QACLU,YAAY;YACVC,MAAM;YACNC,aAAa;YACbC,MAAMX;QACR;QACAS,MAAMd,KAAKiB,MAAM,CAACf,MAAMY,IAAI,EAAE;YAC5BI,cAAcZ,YAAYQ,IAAI;YAC9BT,aAAa;QACf;QACAU,aAAaf,KAAKmB,QAAQ,CAACjB,MAAMa,WAAW,EAAE;YAAEV,aAAa;QAAO;QACpEW,MAAMhB,KAAKmB,QAAQ,CAACjB,MAAMc,IAAI,EAAE;YAC9BE,cAAcV;YACdY,iBAAiB;YACjBf;QACF;IACF;AACF,EAAE"}
|
|
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":["getPartitionedNativeProps","slot","useChatInputEntity_unstable","props","ref","as","elementType","nativeProps","primarySlotTagName","defaultTextSlotProps","target","rel","tabIndex","primary","components","root","sensitivity","text","always","defaultProps","optional","renderByDefault"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AACA,SAASA,yBAAyB,EAAEC,IAAI,QAAQ,6BAA6B;AAG7E,uEAAuE;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,EAAE,EAAE,GAAGF;IAEf,MAAMG,cAAcD,eAAAA,gBAAAA,KAAM;IAE1B,MAAME,cAAcP,0BAA0B;QAAEG;QAAOK,oBAAoBF;IAAY;IAEvF,MAAMG,uBACJH,gBAAgB,MACZ;QACEI,QAAQ;QACRC,KAAK;QACL,wEAAwE;QACxEC,UAAU,CAAC;QACX,GAAGL,YAAYM,OAAO;QACtBR,IAAI;QACJ,0GAA0G;QAC1GD,KAAKA;IACP,IACA;QAAE,GAAGG,YAAYM,OAAO;QAAER,IAAI;QAAiBD;IAAI;IAEzD,OAAO;QACLU,YAAY;YACVC,MAAM;YACNC,aAAa;YACbC,MAAMX;QACR;QACAS,MAAMd,KAAKiB,MAAM,CAACf,MAAMY,IAAI,EAAE;YAC5BI,cAAcZ,YAAYQ,IAAI;YAC9BT,aAAa;QACf;QACAU,aAAaf,KAAKmB,QAAQ,CAACjB,MAAMa,WAAW,EAAE;YAAEV,aAAa;QAAO;QACpEW,MAAMhB,KAAKmB,QAAQ,CAACjB,MAAMc,IAAI,EAAE;YAC9BE,cAAcV;YACdY,iBAAiB;YACjBf;QACF;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useChatInputEntityStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, tokens } from '@fluentui/react-components';\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 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":["makeStyles","mergeClasses","tokens","chatInputEntityClassNames","root","sensitivity","text","useStyles","color","colorBrandForeground1","href","colorBrandForegroundLink","textDecorationLine","colorBrandForegroundLinkHover","colorBrandForegroundLinkPressed","paddingLeft","spacingHorizontalXXS","useChatInputEntityStyles_unstable","state","styles","className","as"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,MAAM,QAAQ,6BAA6B;AAI9E,OAAO,MAAMC,4BAAkE;IAC7EC,MAAM;IACNC,aAAa;IACbC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYP,WAAW;IAC3BI,MAAM,CAAC;IAEPE,MAAM;QACJE,OAAON,OAAOO,qBAAqB;IACrC;IAEAC,MAAM;QACJF,OAAON,OAAOS,wBAAwB;QAEtC,UAAU;YACRC,oBAAoB;YACpBJ,OAAON,OAAOW,6BAA6B;QAC7C;QAEA,WAAW;YACTD,oBAAoB;YACpBJ,OAAON,OAAOY,+BAA+B;QAC/C;IACF;IACAT,aAAa;QACXU,aAAab,OAAOc,oBAAoB;IAC1C;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,oCAAoC,CAACC;IAChD,MAAMC,SAASZ;IAEfW,MAAMd,IAAI,CAACgB,SAAS,GAAGnB,aAAaE,0BAA0BC,IAAI,EAAEe,OAAOf,IAAI,EAAEc,MAAMd,IAAI,CAACgB,SAAS;IAErG,IAAIF,MAAMZ,IAAI,EAAE;QACdY,MAAMZ,IAAI,CAACc,SAAS,GAAGnB,aACrBE,0BAA0BG,IAAI,EAC9Ba,OAAOb,IAAI,EACXY,MAAMZ,IAAI,CAACe,EAAE,KAAK,OAAOF,OAAOT,IAAI,EACpCQ,MAAMZ,IAAI,CAACc,SAAS;IAExB;IAEA,IAAIF,MAAMb,WAAW,EAAE;QACrBa,MAAMb,WAAW,CAACe,SAAS,GAAGnB,aAC5BE,0BAA0BE,WAAW,EACrCc,OAAOd,WAAW,EAClBa,MAAMb,WAAW,CAACe,SAAS;IAE/B;IAEA,OAAOF;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["useChatInputEntityStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, tokens } from '@fluentui/react-components';\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 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":["makeStyles","mergeClasses","tokens","chatInputEntityClassNames","root","sensitivity","text","useStyles","color","colorBrandForeground1","href","colorBrandForegroundLink","textDecorationLine","colorBrandForegroundLinkHover","colorBrandForegroundLinkPressed","paddingLeft","spacingHorizontalXXS","useChatInputEntityStyles_unstable","state","styles","className","as"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,MAAM,QAAQ,6BAA6B;AAI9E,OAAO,MAAMC,4BAAkE;IAC7EC,MAAM;IACNC,aAAa;IACbC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYP,WAAW;IAC3BI,MAAM,CAAC;IAEPE,MAAM;QACJE,OAAON,OAAOO,qBAAqB;IACrC;IAEAC,MAAM;QACJF,OAAON,OAAOS,wBAAwB;QAEtC,UAAU;YACRC,oBAAoB;YACpBJ,OAAON,OAAOW,6BAA6B;QAC7C;QAEA,WAAW;YACTD,oBAAoB;YACpBJ,OAAON,OAAOY,+BAA+B;QAC/C;IACF;IACAT,aAAa;QACXU,aAAab,OAAOc,oBAAoB;IAC1C;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,oCAAoC,CAACC;IAChD,MAAMC,SAASZ;IAEfW,MAAMd,IAAI,CAACgB,SAAS,GAAGnB,aAAaE,0BAA0BC,IAAI,EAAEe,OAAOf,IAAI,EAAEc,MAAMd,IAAI,CAACgB,SAAS;IAErG,IAAIF,MAAMZ,IAAI,EAAE;QACdY,MAAMZ,IAAI,CAACc,SAAS,GAAGnB,aACrBE,0BAA0BG,IAAI,EAC9Ba,OAAOb,IAAI,EACXY,MAAMZ,IAAI,CAACe,EAAE,KAAK,OAAOF,OAAOT,IAAI,EACpCQ,MAAMZ,IAAI,CAACc,SAAS;IAExB;IAEA,IAAIF,MAAMb,WAAW,EAAE;QACrBa,MAAMb,WAAW,CAACe,SAAS,GAAGnB,aAC5BE,0BAA0BE,WAAW,EACrCc,OAAOd,WAAW,EAClBa,MAAMb,WAAW,CAACe,SAAS;IAE/B;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -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';\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":["React","useChatInputToken_unstable","renderChatInputToken_unstable","useChatInputTokenStyles_unstable","ChatInputToken","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAI7E,2BAA2B;AAC3B,OAAO,MAAMC,+BAA2DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQP,2BAA2BK,OAAOC;IAEhDJ,iCAAiCK;IACjC,OAAON,8BAA8BM;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
|
|
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';\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":["React","useChatInputToken_unstable","renderChatInputToken_unstable","useChatInputTokenStyles_unstable","ChatInputToken","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAI7E,2BAA2B;AAC3B,OAAO,MAAMC,+BAA2DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQP,2BAA2BK,OAAOC;IAEhDJ,iCAAiCK;IACjC,OAAON,8BAA8BM;AACvC,GAAG;AAEHJ,eAAeK,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 ...super.exportJSON(),\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 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":["React","DecoratorNode","ChatInputToken","ChatInputTokenNode","getType","clone","node","__text","__componentProps","__key","importJSON","serializedNode","$createChatInputTokenNode","text","componentProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","children","constructor","key","$isChatInputTokenNode"],"mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,aAAa,QAAQ,gCAAgC;AAU9D,SAASC,cAAc,QAAQ,mBAAmB;AAOlD,OAAO,MAAMC,2BAA2BF;IAItC,OAAOG,UAAkB;QACvB,OAAO;IACT;IACA,OAAOC,MAAMC,IAAwB,EAAsB;QACzD,OAAO,IAAIH,mBAAmBG,KAAKC,MAAM,EAAED,KAAKE,gBAAgB,EAAEF,KAAKG,KAAK;IAC9E;IAEA,OAAOC,WAAWC,cAA4C,EAAsB;QAClF,OAAOC,0BAA0BD,eAAeE,IAAI,EAAEF,eAAeG,cAAc;IACrF;IAEAC,aAAa;QACX,OAAO;IACT;IACAC,WAAW;QACT,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAACV,MAAM;IACpB;IAEAW,aAA2C;QACzC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBL,MAAM,IAAI,CAACN,MAAM;YACjBO,gBAAgB,IAAI,CAACN,gBAAgB;YACrCW,MAAMhB,mBAAmBC,OAAO;YAChCgB,SAAS;QACX;IACF;IAQAC,YAAyB;QACvB,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEAC,YAAY;QACV,OAAO;IACT;IAEAC,SAASC,OAAsB,EAAEC,MAAoB,EAAsB;YACrE;QAAJ,KAAI,yBAAA,IAAI,CAACnB,gBAAgB,cAArB,6CAAA,uBAAuBoB,QAAQ,EAAE;YACnC,qBAAO,oBAAC1B,gBAAmB,IAAI,CAACM,gBAAgB;QAClD;QACA,qBAAO,oBAACN,gBAAmB,IAAI,CAACM,gBAAgB,EAAG,IAAI,CAACD,MAAM;IAChE;IAnBAsB,YAAYhB,IAAY,EAAEC,cAAoC,EAAEgB,GAAa,CAAE;QAC7E,KAAK,CAACA;QApCRvB,uBAAAA,UAAAA,KAAAA;QACAC,uBAAAA,oBAAAA,KAAAA;QAoCE,IAAI,CAACD,MAAM,GAAGM;QACd,IAAI,CAACL,gBAAgB,GAAGM;IAC1B;AAgBF;AAEA,OAAO,SAASF,0BACdC,IAAY,EACZC,cAAoC,EACpCgB,GAAa;IAEb,OAAO,IAAI3B,mBAAmBU,MAAMC,gBAAgBgB;AACtD;AAEA,OAAO,SAASC,sBAAsBzB,IAAoC;IACxE,OAAOA,gBAAgBH;AACzB"}
|
|
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 ...super.exportJSON(),\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 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":["React","DecoratorNode","ChatInputToken","ChatInputTokenNode","getType","clone","node","__text","__componentProps","__key","importJSON","serializedNode","$createChatInputTokenNode","text","componentProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","children","constructor","key","$isChatInputTokenNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,aAAa,QAAQ,gCAAgC;AAU9D,SAASC,cAAc,QAAQ,mBAAmB;AAOlD,OAAO,MAAMC,2BAA2BF;IAItC,OAAOG,UAAkB;QACvB,OAAO;IACT;IACA,OAAOC,MAAMC,IAAwB,EAAsB;QACzD,OAAO,IAAIH,mBAAmBG,KAAKC,MAAM,EAAED,KAAKE,gBAAgB,EAAEF,KAAKG,KAAK;IAC9E;IAEA,OAAOC,WAAWC,cAA4C,EAAsB;QAClF,OAAOC,0BAA0BD,eAAeE,IAAI,EAAEF,eAAeG,cAAc;IACrF;IAEAC,aAAa;QACX,OAAO;IACT;IACAC,WAAW;QACT,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAACV,MAAM;IACpB;IAEAW,aAA2C;QACzC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBL,MAAM,IAAI,CAACN,MAAM;YACjBO,gBAAgB,IAAI,CAACN,gBAAgB;YACrCW,MAAMhB,mBAAmBC,OAAO;YAChCgB,SAAS;QACX;IACF;IAQAC,YAAyB;QACvB,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEAC,YAAY;QACV,OAAO;IACT;IAEAC,SAASC,OAAsB,EAAEC,MAAoB,EAAsB;YACrE;QAAJ,KAAI,yBAAA,IAAI,CAACnB,gBAAgB,cAArB,6CAAA,uBAAuBoB,QAAQ,EAAE;YACnC,qBAAO,oBAAC1B,gBAAmB,IAAI,CAACM,gBAAgB;QAClD;QACA,qBAAO,oBAACN,gBAAmB,IAAI,CAACM,gBAAgB,EAAG,IAAI,CAACD,MAAM;IAChE;IAnBAsB,YAAYhB,IAAY,EAAEC,cAAoC,EAAEgB,GAAa,CAAE;QAC7E,KAAK,CAACA;QApCRvB,uBAAAA,UAAAA,KAAAA;QACAC,uBAAAA,oBAAAA,KAAAA;QAoCE,IAAI,CAACD,MAAM,GAAGM;QACd,IAAI,CAACL,gBAAgB,GAAGM;IAC1B;AAgBF;AAEA,OAAO,SAASF,0BACdC,IAAY,EACZC,cAAoC,EACpCgB,GAAa;IAEb,OAAO,IAAI3B,mBAAmBU,MAAMC,gBAAgBgB;AACtD;AAEA,OAAO,SAASC,sBAAsBzB,IAAoC;IACxE,OAAOA,gBAAgBH;AACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatInputToken.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type ChatInputTokenSlots = {\n root: Slot<'span'>;\n};\n\n/**\n * ChatInputToken Props\n */\nexport type ChatInputTokenProps = ComponentProps<ChatInputTokenSlots> & {};\n\n/**\n * State used in rendering ChatInputToken\n */\nexport type ChatInputTokenState = ComponentState<ChatInputTokenSlots>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["ChatInputToken.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type ChatInputTokenSlots = {\n root: Slot<'span'>;\n};\n\n/**\n * ChatInputToken Props\n */\nexport type ChatInputTokenProps = ComponentProps<ChatInputTokenSlots> & {};\n\n/**\n * State used in rendering ChatInputToken\n */\nexport type ChatInputTokenState = ComponentState<ChatInputTokenSlots>;\n"],"names":[],"rangeMappings":";;","mappings":"AAWA;;CAEC,GACD,WAAsE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ChatInputToken';\nexport * from './ChatInputToken.types';\nexport * from './renderChatInputToken';\nexport * from './useChatInputToken';\nexport * from './useChatInputTokenStyles';\nexport * from './ChatInputToken.node';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,4BAA4B;AAC1C,cAAc,wBAAwB"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ChatInputToken';\nexport * from './ChatInputToken.types';\nexport * from './renderChatInputToken';\nexport * from './useChatInputToken';\nexport * from './useChatInputTokenStyles';\nexport * from './ChatInputToken.node';\n"],"names":[],"rangeMappings":";;;;;","mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,4BAA4B;AAC1C,cAAc,wBAAwB"}
|
|
@@ -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":["assertSlots","renderChatInputToken_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5CF,YAAiCE;IAEjC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
|
|
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":["assertSlots","renderChatInputToken_unstable","state","root"],"rangeMappings":";;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5CF,YAAiCE;IAEjC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
|
|
@@ -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":["getIntrinsicElementProps","slot","useChatInputToken_unstable","props","ref","components","root","always","elementType"],"mappings":"AACA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,6BAA6B;AAG5E,uEAAuE;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAML,KAAKM,MAAM,CACfP,yBAAyB,QAAQ;YAC/BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEK,aAAa;QAAO;IAE1B;AACF,EAAE"}
|
|
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":["getIntrinsicElementProps","slot","useChatInputToken_unstable","props","ref","components","root","always","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AACA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,6BAA6B;AAG5E,uEAAuE;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAML,KAAKM,MAAM,CACfP,yBAAyB,QAAQ;YAC/BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEK,aAAa;QAAO;IAE1B;AACF,EAAE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { __resetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';
|
|
1
|
+
import { __resetStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';
|
|
2
2
|
export const chatInputTokenClassNames = {
|
|
3
3
|
root: 'fai-ChatInputToken'
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
6
|
* Styles for the root slot
|
|
7
7
|
*/
|
|
8
|
-
const useBaseClassName = __resetStyles("
|
|
8
|
+
const useBaseClassName = __resetStyles("rjbvsrk", "r1d7fxr6", [".rjbvsrk{font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:inherit;background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorTransparentStroke);border-radius:var(--borderRadiusMedium);-webkit-box-decoration-break:clone;box-decoration-break:clone;color:var(--colorNeutralForeground2);padding-top:var(--spacingVerticalXXS);padding-right:0;padding-bottom:var(--spacingVerticalXXS);padding-left:0;}", ".r1d7fxr6{font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:inherit;background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorTransparentStroke);border-radius:var(--borderRadiusMedium);-webkit-box-decoration-break:clone;box-decoration-break:clone;color:var(--colorNeutralForeground2);padding-top:var(--spacingVerticalXXS);padding-left:0;padding-bottom:var(--spacingVerticalXXS);padding-right:0;}"]);
|
|
9
9
|
/**
|
|
10
10
|
* Apply styling to the ChatInputToken slots based on the state
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useChatInputTokenStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\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.
|
|
1
|
+
{"version":3,"sources":["useChatInputTokenStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\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 backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n borderRadius: tokens.borderRadiusMedium,\n boxDecorationBreak: 'clone',\n color: tokens.colorNeutralForeground2,\n lineHeight: 'inherit',\n ...shorthands.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 const baseClassName = useBaseClassName();\n state.root.className = mergeClasses(chatInputTokenClassNames.root, baseClassName, state.root.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","shorthands","tokens","typographyStyles","chatInputTokenClassNames","root","useBaseClassName","caption1","backgroundColor","colorNeutralBackground3","border","strokeWidthThin","colorTransparentStroke","borderRadius","borderRadiusMedium","boxDecorationBreak","color","colorNeutralForeground2","lineHeight","padding","spacingVerticalXXS","useChatInputTokenStyles_unstable","state","baseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,UAAU,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAIjH,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,mBAAmBP,gBAAgB;IACvC,GAAGI,iBAAiBI,QAAQ;IAC5BC,iBAAiBN,OAAOO,uBAAuB;IAC/CC,QAAQ,CAAC,EAAER,OAAOS,eAAe,CAAC,OAAO,EAAET,OAAOU,sBAAsB,CAAC,CAAC;IAC1EC,cAAcX,OAAOY,kBAAkB;IACvCC,oBAAoB;IACpBC,OAAOd,OAAOe,uBAAuB;IACrCC,YAAY;IACZ,GAAGjB,WAAWkB,OAAO,CAACjB,OAAOkB,kBAAkB,EAAE,EAAE;AACrD;AAEA;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C,MAAMC,gBAAgBjB;IACtBgB,MAAMjB,IAAI,CAACmB,SAAS,GAAGxB,aAAaI,yBAAyBC,IAAI,EAAEkB,eAAeD,MAAMjB,IAAI,CAACmB,SAAS;IAEtG,OAAOF;AACT,EAAE"}
|
|
@@ -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';\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":["React","useGhostText_unstable","renderGhostText_unstable","useGhostTextStyles_unstable","GhostText","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,uBAAuB;AAInE,4CAA4C;AAC5C,OAAO,MAAMC,0BAAiDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQP,sBAAsBK,OAAOC;IAE3CJ,4BAA4BK;IAC5B,OAAON,yBAAyBM;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}
|
|
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';\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":["React","useGhostText_unstable","renderGhostText_unstable","useGhostTextStyles_unstable","GhostText","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,uBAAuB;AAInE,4CAA4C;AAC5C,OAAO,MAAMC,0BAAiDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQP,sBAAsBK,OAAOC;IAE3CJ,4BAA4BK;IAC5B,OAAON,yBAAyBM;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* State used in rendering GhostText
|
|
3
|
+
*/export {}; // TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from GhostTextProps.
|
|
2
4
|
// & Required<Pick<GhostTextProps, 'propName'>>
|
|
3
5
|
//# sourceMappingURL=GhostText.types.js.map
|
|
@@ -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> & {};\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":[],"mappings":"
|
|
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,GACD,WAA4D,CAC5D,0HAA0H;CAC1H,+CAA+C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './GhostText';\nexport * from './GhostText.types';\nexport * from './renderGhostText';\nexport * from './useGhostText';\nexport * from './useGhostTextStyles';\n"],"names":[],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,oBAAoB;AAClC,cAAc,oBAAoB;AAClC,cAAc,iBAAiB;AAC/B,cAAc,uBAAuB"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './GhostText';\nexport * from './GhostText.types';\nexport * from './renderGhostText';\nexport * from './useGhostText';\nexport * from './useGhostTextStyles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,oBAAoB;AAClC,cAAc,oBAAoB;AAClC,cAAc,iBAAiB;AAC/B,cAAc,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderGhostText.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { GhostTextState, GhostTextSlots } from './GhostText.types';\n\n/**\n * Render the final JSX of GhostText\n */\nexport const renderGhostText_unstable = (state: GhostTextState) => {\n assertSlots<GhostTextSlots>(state);\n\n return (\n <state.root>\n {state.root.children}\n {state.indicator && <state.indicator />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderGhostText_unstable","state","root","children","indicator"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvCF,YAA4BE;IAE5B,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAMC,IAAI,CAACC,QAAQ;YACnBF,MAAMG,SAAS,kBAAI,KAACH,MAAMG,SAAS;;;AAG1C,EAAE"}
|
|
1
|
+
{"version":3,"sources":["renderGhostText.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { GhostTextState, GhostTextSlots } from './GhostText.types';\n\n/**\n * Render the final JSX of GhostText\n */\nexport const renderGhostText_unstable = (state: GhostTextState) => {\n assertSlots<GhostTextSlots>(state);\n\n return (\n <state.root>\n {state.root.children}\n {state.indicator && <state.indicator />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderGhostText_unstable","state","root","children","indicator"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvCF,YAA4BE;IAE5B,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAMC,IAAI,CAACC,QAAQ;YACnBF,MAAMG,SAAS,kBAAI,KAACH,MAAMG,SAAS;;;AAG1C,EAAE"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getIntrinsicElementProps, mergeCallbacks, slot } from '@fluentui/react-components';
|
|
3
|
+
import { $getNodeByKey, useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';
|
|
2
4
|
// If you add JSX to this file, be sure to change the file type to .tsx
|
|
3
5
|
/**
|
|
4
6
|
* Create the state required to render GhostText.
|
|
@@ -10,14 +12,34 @@ import { getIntrinsicElementProps, slot } from '@fluentui/react-components';
|
|
|
10
12
|
* @param ref - reference to root HTMLElement of GhostText
|
|
11
13
|
*/
|
|
12
14
|
export const useGhostText_unstable = (props, ref) => {
|
|
13
|
-
|
|
15
|
+
const {
|
|
16
|
+
nodeKey,
|
|
17
|
+
onClick,
|
|
18
|
+
...rest
|
|
19
|
+
} = props;
|
|
20
|
+
const [editor] = useLexicalComposerContext();
|
|
21
|
+
const handleClick = React.useCallback(_ev => {
|
|
22
|
+
if (!nodeKey) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
editor.update(() => {
|
|
26
|
+
var _node_getPreviousSibling;
|
|
27
|
+
const node = $getNodeByKey(nodeKey);
|
|
28
|
+
node === null || node === void 0 ? void 0 : (_node_getPreviousSibling = node.getPreviousSibling()) === null || _node_getPreviousSibling === void 0 ? void 0 : _node_getPreviousSibling.selectEnd();
|
|
29
|
+
}, {
|
|
30
|
+
tag: 'historic'
|
|
31
|
+
});
|
|
32
|
+
}, [editor, nodeKey]);
|
|
33
|
+
const mergedOnClick = mergeCallbacks(handleClick, onClick);
|
|
34
|
+
const state = {
|
|
14
35
|
components: {
|
|
15
36
|
root: 'span',
|
|
16
37
|
indicator: 'span'
|
|
17
38
|
},
|
|
18
39
|
root: slot.always(getIntrinsicElementProps('span', {
|
|
19
40
|
ref,
|
|
20
|
-
|
|
41
|
+
onClick: mergedOnClick,
|
|
42
|
+
...rest
|
|
21
43
|
}), {
|
|
22
44
|
elementType: 'span'
|
|
23
45
|
}),
|
|
@@ -25,5 +47,6 @@ export const useGhostText_unstable = (props, ref) => {
|
|
|
25
47
|
elementType: 'span'
|
|
26
48
|
})
|
|
27
49
|
};
|
|
50
|
+
return state;
|
|
28
51
|
};
|
|
29
52
|
//# sourceMappingURL=useGhostText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useGhostText.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["useGhostText.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeCallbacks, slot } from '@fluentui/react-components';\nimport type { GhostTextProps, GhostTextState } from './GhostText.types';\nimport { $getNodeByKey, useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\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 GhostText.\n *\n * The returned state can be modified with hooks such as useGhostTextStyles_unstable,\n * before being passed to renderGhostText_unstable.\n *\n * @param props - props from this instance of GhostText\n * @param ref - reference to root HTMLElement of GhostText\n */\nexport const useGhostText_unstable = (props: GhostTextProps, ref: React.Ref<HTMLSpanElement>): GhostTextState => {\n const { nodeKey, onClick, ...rest } = props;\n const [editor] = useLexicalComposerContext();\n\n const handleClick = React.useCallback(\n _ev => {\n if (!nodeKey) {\n return;\n }\n\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey);\n node?.getPreviousSibling()?.selectEnd();\n },\n { tag: 'historic' },\n );\n },\n [editor, nodeKey],\n );\n\n const mergedOnClick = mergeCallbacks(handleClick, onClick);\n\n const state: GhostTextState = {\n components: {\n root: 'span',\n indicator: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('span', {\n ref,\n onClick: mergedOnClick,\n ...rest,\n }),\n { elementType: 'span' },\n ),\n indicator: slot.optional(props.indicator, { elementType: 'span' }),\n };\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","mergeCallbacks","slot","$getNodeByKey","useLexicalComposerContext","useGhostText_unstable","props","ref","nodeKey","onClick","rest","editor","handleClick","useCallback","_ev","update","node","getPreviousSibling","selectEnd","tag","mergedOnClick","state","components","root","indicator","always","elementType","optional"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,cAAc,EAAEC,IAAI,QAAQ,6BAA6B;AAE5F,SAASC,aAAa,EAAEC,yBAAyB,QAAQ,sCAAsC;AAE/F,uEAAuE;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC;IAC3D,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAE,GAAGC,MAAM,GAAGJ;IACtC,MAAM,CAACK,OAAO,GAAGP;IAEjB,MAAMQ,cAAcb,MAAMc,WAAW,CACnCC,CAAAA;QACE,IAAI,CAACN,SAAS;YACZ;QACF;QAEAG,OAAOI,MAAM,CACX;gBAEEC;YADA,MAAMA,OAAOb,cAAcK;YAC3BQ,iBAAAA,4BAAAA,2BAAAA,KAAMC,kBAAkB,gBAAxBD,+CAAAA,yBAA4BE,SAAS;QACvC,GACA;YAAEC,KAAK;QAAW;IAEtB,GACA;QAACR;QAAQH;KAAQ;IAGnB,MAAMY,gBAAgBnB,eAAeW,aAAaH;IAElD,MAAMY,QAAwB;QAC5BC,YAAY;YACVC,MAAM;YACNC,WAAW;QACb;QACAD,MAAMrB,KAAKuB,MAAM,CACfzB,yBAAyB,QAAQ;YAC/BO;YACAE,SAASW;YACT,GAAGV,IAAI;QACT,IACA;YAAEgB,aAAa;QAAO;QAExBF,WAAWtB,KAAKyB,QAAQ,CAACrB,MAAMkB,SAAS,EAAE;YAAEE,aAAa;QAAO;IAClE;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useGhostTextStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { GhostTextSlots, GhostTextState } from './GhostText.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const ghostTextClassNames: SlotClassNames<GhostTextSlots> = {\n root: 'fai-GhostText',\n indicator: 'fai-GhostText__indicator',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground3,\n whiteSpace: 'pre-wrap',\n ...shorthands.gap(tokens.spacingHorizontalXS),\n },\n\n indicator: {\n ...typographyStyles.caption2Strong,\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground5,\n ...shorthands.padding(tokens.spacingVerticalNone, tokens.spacingHorizontalSNudge),\n ...shorthands.borderRadius(tokens.borderRadiusSmall),\n marginLeft: tokens.spacingHorizontalXS,\n merginRight: tokens.spacingHorizontalXS,\n },\n});\n\n/**\n * Apply styling to the GhostText slots based on the state\n */\nexport const useGhostTextStyles_unstable = (state: GhostTextState): GhostTextState => {\n const styles = useStyles();\n state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);\n\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n ghostTextClassNames.indicator,\n styles.indicator,\n state.indicator.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","typographyStyles","ghostTextClassNames","root","indicator","useStyles","color","colorNeutralForeground3","whiteSpace","gap","spacingHorizontalXS","caption2Strong","backgroundColor","colorNeutralBackground5","padding","spacingVerticalNone","spacingHorizontalSNudge","borderRadius","borderRadiusSmall","marginLeft","merginRight","useGhostTextStyles_unstable","state","styles","className"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,UAAU,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAI5G,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,WAAW;AACb,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYR,WAAW;IAC3BM,MAAM;QACJG,OAAON,OAAOO,uBAAuB;QACrCC,YAAY;QACZ,GAAGT,WAAWU,GAAG,CAACT,OAAOU,mBAAmB,CAAC;IAC/C;IAEAN,WAAW;QACT,GAAGH,iBAAiBU,cAAc;QAClCL,OAAON,OAAOO,uBAAuB;QACrCK,iBAAiBZ,OAAOa,uBAAuB;QAC/C,GAAGd,WAAWe,OAAO,CAACd,OAAOe,mBAAmB,EAAEf,OAAOgB,uBAAuB,CAAC;QACjF,GAAGjB,WAAWkB,YAAY,CAACjB,OAAOkB,iBAAiB,CAAC;QACpDC,YAAYnB,OAAOU,mBAAmB;QACtCU,aAAapB,OAAOU,mBAAmB;IACzC;AACF;AAEA;;CAEC,GACD,OAAO,MAAMW,8BAA8B,CAACC;IAC1C,MAAMC,SAASlB;IACfiB,MAAMnB,IAAI,CAACqB,SAAS,GAAG1B,aAAaI,oBAAoBC,IAAI,EAAEoB,OAAOpB,IAAI,EAAEmB,MAAMnB,IAAI,CAACqB,SAAS;IAE/F,IAAIF,MAAMlB,SAAS,EAAE;QACnBkB,MAAMlB,SAAS,CAACoB,SAAS,GAAG1B,aAC1BI,oBAAoBE,SAAS,EAC7BmB,OAAOnB,SAAS,EAChBkB,MAAMlB,SAAS,CAACoB,SAAS;IAE7B;IAEA,OAAOF;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["useGhostTextStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { GhostTextSlots, GhostTextState } from './GhostText.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const ghostTextClassNames: SlotClassNames<GhostTextSlots> = {\n root: 'fai-GhostText',\n indicator: 'fai-GhostText__indicator',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground3,\n whiteSpace: 'pre-wrap',\n ...shorthands.gap(tokens.spacingHorizontalXS),\n },\n\n indicator: {\n ...typographyStyles.caption2Strong,\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground5,\n ...shorthands.padding(tokens.spacingVerticalNone, tokens.spacingHorizontalSNudge),\n ...shorthands.borderRadius(tokens.borderRadiusSmall),\n marginLeft: tokens.spacingHorizontalXS,\n merginRight: tokens.spacingHorizontalXS,\n },\n});\n\n/**\n * Apply styling to the GhostText slots based on the state\n */\nexport const useGhostTextStyles_unstable = (state: GhostTextState): GhostTextState => {\n const styles = useStyles();\n state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);\n\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n ghostTextClassNames.indicator,\n styles.indicator,\n state.indicator.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","typographyStyles","ghostTextClassNames","root","indicator","useStyles","color","colorNeutralForeground3","whiteSpace","gap","spacingHorizontalXS","caption2Strong","backgroundColor","colorNeutralBackground5","padding","spacingVerticalNone","spacingHorizontalSNudge","borderRadius","borderRadiusSmall","marginLeft","merginRight","useGhostTextStyles_unstable","state","styles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,UAAU,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAI5G,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,WAAW;AACb,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYR,WAAW;IAC3BM,MAAM;QACJG,OAAON,OAAOO,uBAAuB;QACrCC,YAAY;QACZ,GAAGT,WAAWU,GAAG,CAACT,OAAOU,mBAAmB,CAAC;IAC/C;IAEAN,WAAW;QACT,GAAGH,iBAAiBU,cAAc;QAClCL,OAAON,OAAOO,uBAAuB;QACrCK,iBAAiBZ,OAAOa,uBAAuB;QAC/C,GAAGd,WAAWe,OAAO,CAACd,OAAOe,mBAAmB,EAAEf,OAAOgB,uBAAuB,CAAC;QACjF,GAAGjB,WAAWkB,YAAY,CAACjB,OAAOkB,iBAAiB,CAAC;QACpDC,YAAYnB,OAAOU,mBAAmB;QACtCU,aAAapB,OAAOU,mBAAmB;IACzC;AACF;AAEA;;CAEC,GACD,OAAO,MAAMW,8BAA8B,CAACC;IAC1C,MAAMC,SAASlB;IACfiB,MAAMnB,IAAI,CAACqB,SAAS,GAAG1B,aAAaI,oBAAoBC,IAAI,EAAEoB,OAAOpB,IAAI,EAAEmB,MAAMnB,IAAI,CAACqB,SAAS;IAE/F,IAAIF,MAAMlB,SAAS,EAAE;QACnBkB,MAAMlB,SAAS,CAACoB,SAAS,GAAG1B,aAC1BI,oBAAoBE,SAAS,EAC7BmB,OAAOnB,SAAS,EAChBkB,MAAMlB,SAAS,CAACoB,SAAS;IAE7B;IAEA,OAAOF;AACT,EAAE"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type {\n ChatInputEntityProps,\n ChatInputEntitySlots,\n ChatInputEntityState,\n ChatInputEntityPluginRef,\n SerializedChatInputEntityNode,\n} from './ChatInputEntity';\nexport {\n ChatInputEntity,\n chatInputEntityClassNames,\n renderChatInputEntity_unstable,\n useChatInputEntityStyles_unstable,\n useChatInputEntity_unstable,\n ChatInputEntityNode,\n ChatInputEntityPlugin,\n $isChatInputEntityNode,\n $createChatInputEntityNode,\n} from './ChatInputEntity';\n\nexport type {\n GhostTextProps,\n GhostTextSlots,\n GhostTextState,\n GhostTextPluginProps,\n SerializedGhostTextNode,\n ManualGhostTextRef,\n ManualGhostTextProps,\n} from './GhostText';\nexport {\n GhostText,\n ghostTextClassNames,\n renderGhostText_unstable,\n useGhostTextStyles_unstable,\n useGhostText_unstable,\n GhostTextNode,\n GhostTextPlugin,\n $isGhostTextNode,\n $createGhostTextNode,\n ManualGhostTextPlugin,\n} from './GhostText';\n\nexport type {\n ChatInputTokenProps,\n ChatInputTokenSlots,\n ChatInputTokenState,\n SerializedChatInputTokenNode,\n} from './ChatInputToken';\nexport {\n ChatInputToken,\n ChatInputTokenNode,\n chatInputTokenClassNames,\n renderChatInputToken_unstable,\n useChatInputTokenStyles_unstable,\n useChatInputToken_unstable,\n $createChatInputTokenNode,\n $isChatInputTokenNode,\n} from './ChatInputToken';\n\nexport type { BasicFunctionalityPluginProps, BasicFunctionalityPluginRef } from './BasicFunctionality';\nexport { BasicFunctionalityPlugin } from './BasicFunctionality';\n\nexport type { ImperativeControlPluginProps, ImperativeControlPluginRef } from './ImperativeControl';\nexport { ImperativeControlPlugin } from './ImperativeControl';\n"],"names":["ChatInputEntity","chatInputEntityClassNames","renderChatInputEntity_unstable","useChatInputEntityStyles_unstable","useChatInputEntity_unstable","ChatInputEntityNode","ChatInputEntityPlugin","$isChatInputEntityNode","$createChatInputEntityNode","GhostText","ghostTextClassNames","renderGhostText_unstable","useGhostTextStyles_unstable","useGhostText_unstable","GhostTextNode","GhostTextPlugin","$isGhostTextNode","$createGhostTextNode","ManualGhostTextPlugin","ChatInputToken","ChatInputTokenNode","chatInputTokenClassNames","renderChatInputToken_unstable","useChatInputTokenStyles_unstable","useChatInputToken_unstable","$createChatInputTokenNode","$isChatInputTokenNode","BasicFunctionalityPlugin","ImperativeControlPlugin"],"mappings":"AAOA,SACEA,eAAe,EACfC,yBAAyB,EACzBC,8BAA8B,EAC9BC,iCAAiC,EACjCC,2BAA2B,EAC3BC,mBAAmB,EACnBC,qBAAqB,EACrBC,sBAAsB,EACtBC,0BAA0B,QACrB,oBAAoB;AAW3B,SACEC,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,2BAA2B,EAC3BC,qBAAqB,EACrBC,aAAa,EACbC,eAAe,EACfC,gBAAgB,EAChBC,oBAAoB,EACpBC,qBAAqB,QAChB,cAAc;AAQrB,SACEC,cAAc,EACdC,kBAAkB,EAClBC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,EAC1BC,yBAAyB,EACzBC,qBAAqB,QAChB,mBAAmB;AAG1B,SAASC,wBAAwB,QAAQ,uBAAuB;AAGhE,SAASC,uBAAuB,QAAQ,sBAAsB"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export type {\n ChatInputEntityProps,\n ChatInputEntitySlots,\n ChatInputEntityState,\n ChatInputEntityPluginRef,\n SerializedChatInputEntityNode,\n} from './ChatInputEntity';\nexport {\n ChatInputEntity,\n chatInputEntityClassNames,\n renderChatInputEntity_unstable,\n useChatInputEntityStyles_unstable,\n useChatInputEntity_unstable,\n ChatInputEntityNode,\n ChatInputEntityPlugin,\n $isChatInputEntityNode,\n $createChatInputEntityNode,\n} from './ChatInputEntity';\n\nexport type {\n GhostTextProps,\n GhostTextSlots,\n GhostTextState,\n GhostTextPluginProps,\n SerializedGhostTextNode,\n ManualGhostTextRef,\n ManualGhostTextProps,\n} from './GhostText';\nexport {\n GhostText,\n ghostTextClassNames,\n renderGhostText_unstable,\n useGhostTextStyles_unstable,\n useGhostText_unstable,\n GhostTextNode,\n GhostTextPlugin,\n $isGhostTextNode,\n $createGhostTextNode,\n ManualGhostTextPlugin,\n} from './GhostText';\n\nexport type {\n ChatInputTokenProps,\n ChatInputTokenSlots,\n ChatInputTokenState,\n SerializedChatInputTokenNode,\n} from './ChatInputToken';\nexport {\n ChatInputToken,\n ChatInputTokenNode,\n chatInputTokenClassNames,\n renderChatInputToken_unstable,\n useChatInputTokenStyles_unstable,\n useChatInputToken_unstable,\n $createChatInputTokenNode,\n $isChatInputTokenNode,\n} from './ChatInputToken';\n\nexport type { BasicFunctionalityPluginProps, BasicFunctionalityPluginRef } from './BasicFunctionality';\nexport { BasicFunctionalityPlugin } from './BasicFunctionality';\n\nexport type { ImperativeControlPluginProps, ImperativeControlPluginRef } from './ImperativeControl';\nexport { ImperativeControlPlugin } from './ImperativeControl';\n"],"names":["ChatInputEntity","chatInputEntityClassNames","renderChatInputEntity_unstable","useChatInputEntityStyles_unstable","useChatInputEntity_unstable","ChatInputEntityNode","ChatInputEntityPlugin","$isChatInputEntityNode","$createChatInputEntityNode","GhostText","ghostTextClassNames","renderGhostText_unstable","useGhostTextStyles_unstable","useGhostText_unstable","GhostTextNode","GhostTextPlugin","$isGhostTextNode","$createGhostTextNode","ManualGhostTextPlugin","ChatInputToken","ChatInputTokenNode","chatInputTokenClassNames","renderChatInputToken_unstable","useChatInputTokenStyles_unstable","useChatInputToken_unstable","$createChatInputTokenNode","$isChatInputTokenNode","BasicFunctionalityPlugin","ImperativeControlPlugin"],"rangeMappings":";;;;","mappings":"AAOA,SACEA,eAAe,EACfC,yBAAyB,EACzBC,8BAA8B,EAC9BC,iCAAiC,EACjCC,2BAA2B,EAC3BC,mBAAmB,EACnBC,qBAAqB,EACrBC,sBAAsB,EACtBC,0BAA0B,QACrB,oBAAoB;AAW3B,SACEC,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,2BAA2B,EAC3BC,qBAAqB,EACrBC,aAAa,EACbC,eAAe,EACfC,gBAAgB,EAChBC,oBAAoB,EACpBC,qBAAqB,QAChB,cAAc;AAQrB,SACEC,cAAc,EACdC,kBAAkB,EAClBC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,EAC1BC,yBAAyB,EACzBC,qBAAqB,QAChB,mBAAmB;AAG1B,SAASC,wBAAwB,QAAQ,uBAAuB;AAGhE,SAASC,uBAAuB,QAAQ,sBAAsB"}
|
|
@@ -7,7 +7,8 @@ export const BasicFunctionalityPlugin = React.forwardRef((props, ref) => {
|
|
|
7
7
|
defaultValue,
|
|
8
8
|
trimWhitespace,
|
|
9
9
|
onCountChanged,
|
|
10
|
-
onContentChange
|
|
10
|
+
onContentChange,
|
|
11
|
+
onPaste
|
|
11
12
|
} = props;
|
|
12
13
|
const [editor] = useLexicalComposerContext();
|
|
13
14
|
const basicFunctionalityImpl = React.useRef(null);
|
|
@@ -39,6 +40,16 @@ export const BasicFunctionalityPlugin = React.forwardRef((props, ref) => {
|
|
|
39
40
|
return (_basicFunctionalityImpl_current = basicFunctionalityImpl.current) === null || _basicFunctionalityImpl_current === void 0 ? void 0 : _basicFunctionalityImpl_current.deactivateContentCallbacks();
|
|
40
41
|
};
|
|
41
42
|
}, [editor, onContentChange, onCountChanged]);
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
if (onPaste) {
|
|
45
|
+
var _basicFunctionalityImpl_current;
|
|
46
|
+
(_basicFunctionalityImpl_current = basicFunctionalityImpl.current) === null || _basicFunctionalityImpl_current === void 0 ? void 0 : _basicFunctionalityImpl_current.activatePasteCallback(onPaste);
|
|
47
|
+
}
|
|
48
|
+
return () => {
|
|
49
|
+
var _basicFunctionalityImpl_current;
|
|
50
|
+
return (_basicFunctionalityImpl_current = basicFunctionalityImpl.current) === null || _basicFunctionalityImpl_current === void 0 ? void 0 : _basicFunctionalityImpl_current.deactivatePasteCallback();
|
|
51
|
+
};
|
|
52
|
+
}, [editor, onPaste]);
|
|
42
53
|
React.useEffect(() => {
|
|
43
54
|
if (trimWhitespace) {
|
|
44
55
|
var _basicFunctionalityImpl_current;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n defaultValue?: string;\n // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { defaultValue, trimWhitespace, onCountChanged, onContentChange } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const basicFunctionalityImpl = React.useRef<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n basicFunctionalityImpl.current = new BasicFunctionalityBase(editor);\n\n return () => basicFunctionalityImpl.current?.cleanup();\n }, [editor]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(ref, () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl.current?.setIsDisabled(isDisabled);\n },\n }));\n\n // useIsomporphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (defaultValue) {\n basicFunctionalityImpl.current?.insertDefaultValue(defaultValue);\n }\n }, [editor]);\n\n React.useEffect(() => {\n basicFunctionalityImpl.current?.activateContentCallbacks(onContentChange, onCountChanged);\n return () => basicFunctionalityImpl.current?.deactivateContentCallbacks();\n }, [editor, onContentChange, onCountChanged]);\n\n React.useEffect(() => {\n if (trimWhitespace) {\n basicFunctionalityImpl.current?.activateTrimWhitespace();\n }\n return () => basicFunctionalityImpl.current?.deactivateTrimWhitespace();\n }, [editor, trimWhitespace]);\n\n return null;\n },\n);\n"],"names":["React","useLexicalComposerContext","useIsomorphicLayoutEffect","BasicFunctionalityBase","BasicFunctionalityPlugin","forwardRef","props","ref","defaultValue","trimWhitespace","onCountChanged","onContentChange","editor","basicFunctionalityImpl","useRef","current","cleanup","useImperativeHandle","setIsDisabled","isDisabled","insertDefaultValue","useEffect","activateContentCallbacks","deactivateContentCallbacks","activateTrimWhitespace","deactivateTrimWhitespace"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF,SAASC,yBAAyB,QAAQ,6BAA6B;AAEvE,SAASC,sBAAsB,QAAQ,uCAAuC;
|
|
1
|
+
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n defaultValue?: string;\n // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n onPaste?: (event: ClipboardEvent) => void;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { defaultValue, trimWhitespace, onCountChanged, onContentChange, onPaste } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const basicFunctionalityImpl = React.useRef<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n basicFunctionalityImpl.current = new BasicFunctionalityBase(editor);\n\n return () => basicFunctionalityImpl.current?.cleanup();\n }, [editor]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(ref, () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl.current?.setIsDisabled(isDisabled);\n },\n }));\n\n // useIsomporphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (defaultValue) {\n basicFunctionalityImpl.current?.insertDefaultValue(defaultValue);\n }\n }, [editor]);\n\n React.useEffect(() => {\n basicFunctionalityImpl.current?.activateContentCallbacks(onContentChange, onCountChanged);\n return () => basicFunctionalityImpl.current?.deactivateContentCallbacks();\n }, [editor, onContentChange, onCountChanged]);\n\n React.useEffect(() => {\n if (onPaste) {\n basicFunctionalityImpl.current?.activatePasteCallback(onPaste);\n }\n return () => basicFunctionalityImpl.current?.deactivatePasteCallback();\n }, [editor, onPaste]);\n\n React.useEffect(() => {\n if (trimWhitespace) {\n basicFunctionalityImpl.current?.activateTrimWhitespace();\n }\n return () => basicFunctionalityImpl.current?.deactivateTrimWhitespace();\n }, [editor, trimWhitespace]);\n\n return null;\n },\n);\n"],"names":["React","useLexicalComposerContext","useIsomorphicLayoutEffect","BasicFunctionalityBase","BasicFunctionalityPlugin","forwardRef","props","ref","defaultValue","trimWhitespace","onCountChanged","onContentChange","onPaste","editor","basicFunctionalityImpl","useRef","current","cleanup","useImperativeHandle","setIsDisabled","isDisabled","insertDefaultValue","useEffect","activateContentCallbacks","deactivateContentCallbacks","activatePasteCallback","deactivatePasteCallback","activateTrimWhitespace","deactivateTrimWhitespace"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF,SAASC,yBAAyB,QAAQ,6BAA6B;AAEvE,SAASC,sBAAsB,QAAQ,uCAAuC;AAe9E,OAAO,MAAMC,2BAA2BJ,MAAMK,UAAU,CACtD,CAACC,OAAOC;IACN,MAAM,EAAEC,YAAY,EAAEC,cAAc,EAAEC,cAAc,EAAEC,eAAe,EAAEC,OAAO,EAAE,GAAGN;IAEnF,MAAM,CAACO,OAAO,GAAGZ;IAEjB,MAAMa,yBAAyBd,MAAMe,MAAM,CAAiC;IAE5Eb,0BAA0B;QACxBY,uBAAuBE,OAAO,GAAG,IAAIb,uBAAuBU;QAE5D,OAAO;gBAAMC;oBAAAA,kCAAAA,uBAAuBE,OAAO,cAA9BF,sDAAAA,gCAAgCG,OAAO;;IACtD,GAAG;QAACJ;KAAO;IAEXb,MAAMkB,mBAAmB,CAA2DX,KAAK,IAAO,CAAA;YAC9FY,eAAcC,UAAmB;oBAC/BN;iBAAAA,kCAAAA,uBAAuBE,OAAO,cAA9BF,sDAAAA,gCAAgCK,aAAa,CAACC;YAChD;QACF,CAAA;IAEA,yEAAyE;IACzElB,0BAA0B;QACxB,IAAIM,cAAc;gBAChBM;aAAAA,kCAAAA,uBAAuBE,OAAO,cAA9BF,sDAAAA,gCAAgCO,kBAAkB,CAACb;QACrD;IACF,GAAG;QAACK;KAAO;IAEXb,MAAMsB,SAAS,CAAC;YACdR;SAAAA,kCAAAA,uBAAuBE,OAAO,cAA9BF,sDAAAA,gCAAgCS,wBAAwB,CAACZ,iBAAiBD;QAC1E,OAAO;gBAAMI;oBAAAA,kCAAAA,uBAAuBE,OAAO,cAA9BF,sDAAAA,gCAAgCU,0BAA0B;;IACzE,GAAG;QAACX;QAAQF;QAAiBD;KAAe;IAE5CV,MAAMsB,SAAS,CAAC;QACd,IAAIV,SAAS;gBACXE;aAAAA,kCAAAA,uBAAuBE,OAAO,cAA9BF,sDAAAA,gCAAgCW,qBAAqB,CAACb;QACxD;QACA,OAAO;gBAAME;oBAAAA,kCAAAA,uBAAuBE,OAAO,cAA9BF,sDAAAA,gCAAgCY,uBAAuB;;IACtE,GAAG;QAACb;QAAQD;KAAQ;IAEpBZ,MAAMsB,SAAS,CAAC;QACd,IAAIb,gBAAgB;gBAClBK;aAAAA,kCAAAA,uBAAuBE,OAAO,cAA9BF,sDAAAA,gCAAgCa,sBAAsB;QACxD;QACA,OAAO;gBAAMb;oBAAAA,kCAAAA,uBAAuBE,OAAO,cAA9BF,sDAAAA,gCAAgCc,wBAAwB;;IACvE,GAAG;QAACf;QAAQJ;KAAe;IAE3B,OAAO;AACT,GACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './BasicFunctionality';\n"],"names":[],"mappings":"AAAA,cAAc,uBAAuB"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './BasicFunctionality';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatInputEntity.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 { ChatInputEntityProps } from '../../ChatInputEntity';\nimport { ChatInputEntity } from '../../ChatInputEntity';\nimport type { ChatInputEntityData } from '@fluentui-copilot/chat-input-plugins';\n\nexport type SerializedChatInputEntityNode<T> = Spread<\n { pluginId: string; text: string; data?: T; entityProps?: ChatInputEntityProps },\n SerializedLexicalNode\n>;\n\nexport class ChatInputEntityNode<T> extends DecoratorNode<JSX.Element | null> {\n __pluginId: string;\n __text: string;\n __entityProps?: ChatInputEntityProps;\n __data?: T;\n\n static getType(): string {\n return 'entity';\n }\n static clone<T>(node: ChatInputEntityNode<T>): ChatInputEntityNode<T> {\n return new ChatInputEntityNode(node.__pluginId, node.__text, node.__data, node.__entityProps, node.__key);\n }\n\n static importJSON<T>(serializedNode: SerializedChatInputEntityNode<T>): ChatInputEntityNode<T> {\n return $createChatInputEntityNode(\n serializedNode.pluginId,\n serializedNode.text,\n serializedNode.data,\n serializedNode.entityProps,\n );\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(): SerializedChatInputEntityNode<T> {\n return {\n ...super.exportJSON(),\n pluginId: this.__pluginId,\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps,\n type: ChatInputEntityNode.getType(),\n version: 1,\n };\n }\n\n constructor(pluginId: string, text: string, data?: T, entityProps?: ChatInputEntityProps, key?: NodeKey) {\n super(key);\n this.__pluginId = pluginId;\n this.__text = text;\n this.__data = data;\n this.__entityProps = entityProps;\n }\n\n createDOM(): HTMLElement {\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.__entityProps?.children) {\n return <ChatInputEntity {...this.__entityProps} />;\n }\n return <ChatInputEntity {...this.__entityProps}>{this.__text}</ChatInputEntity>;\n }\n\n getEntityData(): ChatInputEntityData<T, ChatInputEntityProps> {\n return {\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps,\n };\n }\n\n updateEntityData(data: ChatInputEntityData<T, ChatInputEntityProps>) {\n const writable = this.getWritable();\n writable.__text = data.text;\n writable.__data = data.data;\n writable.__entityProps = data.entityProps;\n }\n}\n\nexport function $createChatInputEntityNode<T>(\n pluginId: string,\n text: string,\n data?: T,\n entityProps?: ChatInputEntityProps,\n key?: NodeKey,\n): ChatInputEntityNode<T> {\n return new ChatInputEntityNode(pluginId, text, data, entityProps, key);\n}\n\nexport function $isChatInputEntityNode<T>(node: LexicalNode | null | undefined): node is ChatInputEntityNode<T> {\n return node instanceof ChatInputEntityNode;\n}\n"],"names":["React","DecoratorNode","ChatInputEntity","ChatInputEntityNode","getType","clone","node","__pluginId","__text","__data","__entityProps","__key","importJSON","serializedNode","$createChatInputEntityNode","pluginId","text","data","entityProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","children","getEntityData","updateEntityData","writable","getWritable","constructor","key","$isChatInputEntityNode"],"mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,aAAa,QAAQ,gCAAgC;AAU9D,SAASC,eAAe,QAAQ,wBAAwB;AAQxD,OAAO,MAAMC,4BAA+BF;IAM1C,OAAOG,UAAkB;QACvB,OAAO;IACT;IACA,OAAOC,MAASC,IAA4B,EAA0B;QACpE,OAAO,IAAIH,oBAAoBG,KAAKC,UAAU,EAAED,KAAKE,MAAM,EAAEF,KAAKG,MAAM,EAAEH,KAAKI,aAAa,EAAEJ,KAAKK,KAAK;IAC1G;IAEA,OAAOC,WAAcC,cAAgD,EAA0B;QAC7F,OAAOC,2BACLD,eAAeE,QAAQ,EACvBF,eAAeG,IAAI,EACnBH,eAAeI,IAAI,EACnBJ,eAAeK,WAAW;IAE9B;IAEAC,aAAa;QACX,OAAO;IACT;IACAC,WAAW;QACT,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAACb,MAAM;IACpB;IAEAc,aAA+C;QAC7C,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBP,UAAU,IAAI,CAACR,UAAU;YACzBS,MAAM,IAAI,CAACR,MAAM;YACjBS,MAAM,IAAI,CAACR,MAAM;YACjBS,aAAa,IAAI,CAACR,aAAa;YAC/Ba,MAAMpB,oBAAoBC,OAAO;YACjCoB,SAAS;QACX;IACF;IAUAC,YAAyB;QACvB,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEAC,YAAY;QACV,OAAO;IACT;IAEAC,SAASC,OAAsB,EAAEC,MAAoB,EAAsB;YACrE;QAAJ,KAAI,sBAAA,IAAI,CAACrB,aAAa,cAAlB,0CAAA,oBAAoBsB,QAAQ,EAAE;YAChC,qBAAO,oBAAC9B,iBAAoB,IAAI,CAACQ,aAAa;QAChD;QACA,qBAAO,oBAACR,iBAAoB,IAAI,CAACQ,aAAa,EAAG,IAAI,CAACF,MAAM;IAC9D;IAEAyB,gBAA8D;QAC5D,OAAO;YACLjB,MAAM,IAAI,CAACR,MAAM;YACjBS,MAAM,IAAI,CAACR,MAAM;YACjBS,aAAa,IAAI,CAACR,aAAa;QACjC;IACF;IAEAwB,iBAAiBjB,IAAkD,EAAE;QACnE,MAAMkB,WAAW,IAAI,CAACC,WAAW;QACjCD,SAAS3B,MAAM,GAAGS,KAAKD,IAAI;QAC3BmB,SAAS1B,MAAM,GAAGQ,KAAKA,IAAI;QAC3BkB,SAASzB,aAAa,GAAGO,KAAKC,WAAW;IAC3C;IApCAmB,YAAYtB,QAAgB,EAAEC,IAAY,EAAEC,IAAQ,EAAEC,WAAkC,EAAEoB,GAAa,CAAE;QACvG,KAAK,CAACA;QA7CR/B,uBAAAA,cAAAA,KAAAA;QACAC,uBAAAA,UAAAA,KAAAA;QACAE,uBAAAA,iBAAAA,KAAAA;QACAD,uBAAAA,UAAAA,KAAAA;QA2CE,IAAI,CAACF,UAAU,GAAGQ;QAClB,IAAI,CAACP,MAAM,GAAGQ;QACd,IAAI,CAACP,MAAM,GAAGQ;QACd,IAAI,CAACP,aAAa,GAAGQ;IACvB;AA+BF;AAEA,OAAO,SAASJ,2BACdC,QAAgB,EAChBC,IAAY,EACZC,IAAQ,EACRC,WAAkC,EAClCoB,GAAa;IAEb,OAAO,IAAInC,oBAAoBY,UAAUC,MAAMC,MAAMC,aAAaoB;AACpE;AAEA,OAAO,SAASC,uBAA0BjC,IAAoC;IAC5E,OAAOA,gBAAgBH;AACzB"}
|
|
1
|
+
{"version":3,"sources":["ChatInputEntity.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 { ChatInputEntityProps } from '../../ChatInputEntity';\nimport { ChatInputEntity } from '../../ChatInputEntity';\nimport type { ChatInputEntityData } from '@fluentui-copilot/chat-input-plugins';\n\nexport type SerializedChatInputEntityNode<T> = Spread<\n { pluginId: string; text: string; data?: T; entityProps?: ChatInputEntityProps },\n SerializedLexicalNode\n>;\n\nexport class ChatInputEntityNode<T> extends DecoratorNode<JSX.Element | null> {\n __pluginId: string;\n __text: string;\n __entityProps?: ChatInputEntityProps;\n __data?: T;\n\n static getType(): string {\n return 'entity';\n }\n static clone<T>(node: ChatInputEntityNode<T>): ChatInputEntityNode<T> {\n return new ChatInputEntityNode(node.__pluginId, node.__text, node.__data, node.__entityProps, node.__key);\n }\n\n static importJSON<T>(serializedNode: SerializedChatInputEntityNode<T>): ChatInputEntityNode<T> {\n return $createChatInputEntityNode(\n serializedNode.pluginId,\n serializedNode.text,\n serializedNode.data,\n serializedNode.entityProps,\n );\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(): SerializedChatInputEntityNode<T> {\n return {\n ...super.exportJSON(),\n pluginId: this.__pluginId,\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps,\n type: ChatInputEntityNode.getType(),\n version: 1,\n };\n }\n\n constructor(pluginId: string, text: string, data?: T, entityProps?: ChatInputEntityProps, key?: NodeKey) {\n super(key);\n this.__pluginId = pluginId;\n this.__text = text;\n this.__data = data;\n this.__entityProps = entityProps;\n }\n\n createDOM(): HTMLElement {\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.__entityProps?.children) {\n return <ChatInputEntity {...this.__entityProps} />;\n }\n return <ChatInputEntity {...this.__entityProps}>{this.__text}</ChatInputEntity>;\n }\n\n getEntityData(): ChatInputEntityData<T, ChatInputEntityProps> {\n return {\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps,\n };\n }\n\n updateEntityData(data: ChatInputEntityData<T, ChatInputEntityProps>) {\n const writable = this.getWritable();\n writable.__text = data.text;\n writable.__data = data.data;\n writable.__entityProps = data.entityProps;\n }\n}\n\nexport function $createChatInputEntityNode<T>(\n pluginId: string,\n text: string,\n data?: T,\n entityProps?: ChatInputEntityProps,\n key?: NodeKey,\n): ChatInputEntityNode<T> {\n return new ChatInputEntityNode(pluginId, text, data, entityProps, key);\n}\n\nexport function $isChatInputEntityNode<T>(node: LexicalNode | null | undefined): node is ChatInputEntityNode<T> {\n return node instanceof ChatInputEntityNode;\n}\n"],"names":["React","DecoratorNode","ChatInputEntity","ChatInputEntityNode","getType","clone","node","__pluginId","__text","__data","__entityProps","__key","importJSON","serializedNode","$createChatInputEntityNode","pluginId","text","data","entityProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","children","getEntityData","updateEntityData","writable","getWritable","constructor","key","$isChatInputEntityNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,aAAa,QAAQ,gCAAgC;AAU9D,SAASC,eAAe,QAAQ,wBAAwB;AAQxD,OAAO,MAAMC,4BAA+BF;IAM1C,OAAOG,UAAkB;QACvB,OAAO;IACT;IACA,OAAOC,MAASC,IAA4B,EAA0B;QACpE,OAAO,IAAIH,oBAAoBG,KAAKC,UAAU,EAAED,KAAKE,MAAM,EAAEF,KAAKG,MAAM,EAAEH,KAAKI,aAAa,EAAEJ,KAAKK,KAAK;IAC1G;IAEA,OAAOC,WAAcC,cAAgD,EAA0B;QAC7F,OAAOC,2BACLD,eAAeE,QAAQ,EACvBF,eAAeG,IAAI,EACnBH,eAAeI,IAAI,EACnBJ,eAAeK,WAAW;IAE9B;IAEAC,aAAa;QACX,OAAO;IACT;IACAC,WAAW;QACT,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAACb,MAAM;IACpB;IAEAc,aAA+C;QAC7C,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBP,UAAU,IAAI,CAACR,UAAU;YACzBS,MAAM,IAAI,CAACR,MAAM;YACjBS,MAAM,IAAI,CAACR,MAAM;YACjBS,aAAa,IAAI,CAACR,aAAa;YAC/Ba,MAAMpB,oBAAoBC,OAAO;YACjCoB,SAAS;QACX;IACF;IAUAC,YAAyB;QACvB,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEAC,YAAY;QACV,OAAO;IACT;IAEAC,SAASC,OAAsB,EAAEC,MAAoB,EAAsB;YACrE;QAAJ,KAAI,sBAAA,IAAI,CAACrB,aAAa,cAAlB,0CAAA,oBAAoBsB,QAAQ,EAAE;YAChC,qBAAO,oBAAC9B,iBAAoB,IAAI,CAACQ,aAAa;QAChD;QACA,qBAAO,oBAACR,iBAAoB,IAAI,CAACQ,aAAa,EAAG,IAAI,CAACF,MAAM;IAC9D;IAEAyB,gBAA8D;QAC5D,OAAO;YACLjB,MAAM,IAAI,CAACR,MAAM;YACjBS,MAAM,IAAI,CAACR,MAAM;YACjBS,aAAa,IAAI,CAACR,aAAa;QACjC;IACF;IAEAwB,iBAAiBjB,IAAkD,EAAE;QACnE,MAAMkB,WAAW,IAAI,CAACC,WAAW;QACjCD,SAAS3B,MAAM,GAAGS,KAAKD,IAAI;QAC3BmB,SAAS1B,MAAM,GAAGQ,KAAKA,IAAI;QAC3BkB,SAASzB,aAAa,GAAGO,KAAKC,WAAW;IAC3C;IApCAmB,YAAYtB,QAAgB,EAAEC,IAAY,EAAEC,IAAQ,EAAEC,WAAkC,EAAEoB,GAAa,CAAE;QACvG,KAAK,CAACA;QA7CR/B,uBAAAA,cAAAA,KAAAA;QACAC,uBAAAA,UAAAA,KAAAA;QACAE,uBAAAA,iBAAAA,KAAAA;QACAD,uBAAAA,UAAAA,KAAAA;QA2CE,IAAI,CAACF,UAAU,GAAGQ;QAClB,IAAI,CAACP,MAAM,GAAGQ;QACd,IAAI,CAACP,MAAM,GAAGQ;QACd,IAAI,CAACP,aAAa,GAAGQ;IACvB;AA+BF;AAEA,OAAO,SAASJ,2BACdC,QAAgB,EAChBC,IAAY,EACZC,IAAQ,EACRC,WAAkC,EAClCoB,GAAa;IAEb,OAAO,IAAInC,oBAAoBY,UAAUC,MAAMC,MAAMC,aAAaoB;AACpE;AAEA,OAAO,SAASC,uBAA0BjC,IAAoC;IAC5E,OAAOA,gBAAgBH;AACzB"}
|