@homecode/ui 5.3.9 → 5.3.10

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.
@@ -59,6 +59,7 @@ import '../PromptComposer/PromptComposer.js';
59
59
  import '@tiptap/extensions';
60
60
  import '@tiptap/react';
61
61
  import '@tiptap/starter-kit';
62
+ import '../PromptComposer/PromptComposer.styl.js';
62
63
  import '../RadioGroup/RadioGroupContext.js';
63
64
  import '../RadioButton/RadioButton.styl.js';
64
65
  import '../RadioGroup/RadioGroup.styl.js';
@@ -58,6 +58,7 @@ import '../PromptComposer/PromptComposer.js';
58
58
  import '@tiptap/extensions';
59
59
  import '@tiptap/react';
60
60
  import '@tiptap/starter-kit';
61
+ import '../PromptComposer/PromptComposer.styl.js';
61
62
  import '../../tiptap/slash-mention/createSlashMentionExtension.js';
62
63
  import '../RadioGroup/RadioGroupContext.js';
63
64
  import '../RadioButton/RadioButton.styl.js';
@@ -1,7 +1,7 @@
1
1
  import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = ".PromptComposer_root__gfdXN{width:100%}.PromptComposer_scroller__Sueif{flex:1;max-height:200px;min-height:40px;width:100%}.PromptComposer_editorMount__B9G-o{background:transparent;border:none;border-radius:0!important;box-shadow:none!important;display:flex;flex:1;flex-direction:column;min-height:40px;min-width:0;padding:0!important}.PromptComposer_editorMount__B9G-o:focus-within{box-shadow:none!important}.PromptComposer_editorMount__B9G-o .promptComposerEditor{border:none!important;box-shadow:none!important;flex:1;margin:0;min-height:40px!important;outline:none!important;overflow:hidden!important;padding:var(--p-2) 0 0!important;resize:none!important;white-space:pre-wrap;word-break:break-word}.PromptComposer_editorMount__B9G-o .promptComposerEmptyEditor .promptComposerEmptyNode:before{color:var(--muted-foreground);content:attr(data-placeholder);float:left;height:0;pointer-events:none}";
4
- var S = {"root":"PromptComposer_root__gfdXN","scroller":"PromptComposer_scroller__Sueif","editorMount":"PromptComposer_editorMount__B9G-o"};
3
+ var css_248z = ".PromptComposer_root__gfdXN{width:100%}.PromptComposer_scroller__Sueif{flex:1;max-height:200px;min-height:40px;width:100%}.PromptComposer_editorMount__B9G-o{background:transparent;border:none;border-radius:0!important;box-shadow:none!important;display:flex;flex:1;flex-direction:column;min-height:40px;min-width:0;padding:0!important}.PromptComposer_editorMount__B9G-o:focus-within{box-shadow:none!important}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEditor__yQIpq{border:none!important;box-shadow:none!important;flex:1;margin:0;min-height:40px!important;outline:none!important;overflow:hidden!important;padding:var(--p-2) 0 0!important;resize:none!important;transition:opacity .1s ease-out;white-space:pre-wrap;word-break:break-word}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEditor__yQIpq a{color:var(--link-color)}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEditor__yQIpq a:hover{cursor:pointer;opacity:.8}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEmptyEditor__VrwNe .PromptComposer_promptComposerEmptyNode__62Ylm:before{color:var(--muted-foreground);content:attr(data-placeholder);float:left;height:0;pointer-events:none}";
4
+ var S = {"root":"PromptComposer_root__gfdXN","scroller":"PromptComposer_scroller__Sueif","editorMount":"PromptComposer_editorMount__B9G-o","promptComposerEditor":"PromptComposer_promptComposerEditor__yQIpq","promptComposerEmptyEditor":"PromptComposer_promptComposerEmptyEditor__VrwNe","promptComposerEmptyNode":"PromptComposer_promptComposerEmptyNode__62Ylm"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { S as default };
@@ -2,14 +2,12 @@ import { useRef, useCallback, useMemo, useState, useEffect, useLayoutEffect } fr
2
2
  import { Placeholder } from '@tiptap/extensions';
3
3
  import { useEditor } from '@tiptap/react';
4
4
  import StarterKit from '@tiptap/starter-kit';
5
+ import S from './PromptComposer.styl.js';
5
6
  import { DEFAULT_CHAT_SLASH_ITEMS } from '../../tiptap/slash-mention/defaultChatSlashItems.js';
6
7
  import { createSlashMentionExtension } from '../../tiptap/slash-mention/createSlashMentionExtension.js';
7
8
  import { safePromptComposerEditorText, promptComposerSafeEditorDom, syncPromptComposerHeight } from './PromptComposer.helpers.js';
8
9
  import { PROMPT_COMPOSER_EMPTY_DOC, promptComposerParagraphDoc } from './promptComposerDoc.js';
9
10
 
10
- const PROMPT_COMPOSER_EDITOR_CLASS = 'promptComposerEditor';
11
- const PROMPT_COMPOSER_EMPTY_EDITOR_CLASS = 'promptComposerEmptyEditor';
12
- const PROMPT_COMPOSER_EMPTY_NODE_CLASS = 'promptComposerEmptyNode';
13
11
  function usePromptComposerEditor({ disabled, placeholder, slashCommandItems, slashSuggestionPlacement = 'above', onSlashItemCommand, prefillMessage, attachmentsCount = 0, allowEnterSubmit, onSubmit, onChange, }) {
14
12
  const slashOpenRef = useRef(false);
15
13
  const onSlashItemCommandRef = useRef(onSlashItemCommand);
@@ -50,8 +48,7 @@ function usePromptComposerEditor({ disabled, placeholder, slashCommandItems, sla
50
48
  Placeholder.configure({
51
49
  placeholder: placeholderText,
52
50
  showOnlyWhenEditable: true,
53
- emptyEditorClass: PROMPT_COMPOSER_EMPTY_EDITOR_CLASS,
54
- emptyNodeClass: PROMPT_COMPOSER_EMPTY_NODE_CLASS,
51
+ emptyNodeClass: S.promptComposerEmptyNode,
55
52
  }),
56
53
  ];
57
54
  if (slashItemsStable.length > 0) {
@@ -121,7 +118,7 @@ function usePromptComposerEditor({ disabled, placeholder, slashCommandItems, sla
121
118
  attributes: {
122
119
  spellcheck: 'true',
123
120
  'aria-label': ariaLabelComposer,
124
- class: PROMPT_COMPOSER_EDITOR_CLASS,
121
+ class: S.promptComposerEditor,
125
122
  },
126
123
  handleKeyDown: handleEditorKeyDown,
127
124
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homecode/ui",
3
- "version": "5.3.9",
3
+ "version": "5.3.10",
4
4
  "description": "React UI components library",
5
5
  "scripts": {
6
6
  "tests": "jest",