
Security News
OpenGrep Restores Fingerprinting in JSON and SARIF Outputs
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
@codelic/chat-components
Advanced tools
@codelic/chat-components(CodelicMagneterChat)
fairebase,magnetarと併用を想定したチャットコンポーネントです。 動的なチャット機能をサポートします.
会社毎のチャット作成例
高さ幅ともにwrapして使用してください。
import {
CMCSelectRooms,
} from '@codelic/chat-components'
<div style="height: 100vh">
<CMCRoom
:key="chatRoomId"
:magnetarInstance="magnetar"
:dbFirebaseStorage="storage"
:chatRoomId="chatRoomId"
:sender="userId"
/>
</div>
ルーム選択+ルーム作成機能()
const createDbChatRoom = async (
selectData: {
id: string
name: string
}[]
) => {
try {
//選択したグループをidを格納した配列に変換
const selectedGroupIds = selectData.map((d) => d.id)
// 選択したindexグループを取得
// TODO:ここでグループじゃない場合の対応をしなければならない
const selectedGroups = indexCompany.value.filter((group) =>
selectedGroupIds.includes(group.id)
)
// 配列の[]だけ削除
const titleCreate = (target: string) =>
target.replace(/]/g, '').replace(/\[/g, '')
const titleGroup = selectedGroups.map((user) => user.name).toLocaleString()
const res = await openRoomCreateGroups(
magnetar,
titleCreate(titleGroup),
window.userId,
selectedGroups
)
if (res === 'success') {
isClick.value = !isClick.value
}
} catch (error) {
console.error(error)
}
}
const indexCompany = ref<Group[]>([
{
kind: 'group',
id: 'test_company1',
name: 'テスト株式会社1',
memberIds: [
{ id: 'test1', name: 'テスト太郎' },
{ id: 'test2', name: 'テスト二郎' },
{ id: 'test3', name: 'テスト三郎' },
],
},
{
kind: 'group',
id: 'test_company2',
name: 'テスト株式会社2',
memberIds: [
{ id: 'test4', name: '瀬川大輝4' },
{ id: 'test5', name: '瀬川大輝5' },
{ id: 'test6', name: '瀬川大輝6' },
{ id: 'test7', name: '瀬川大輝7' },
],
},
])
<button class="test" @click="isClick = !isClick">{{ '新規作成' }}</button>
<div style="height: 50vh; width: 100vw; overflow: scroll">
<CMCSelectRooms
:magnetar-instance="magnetar"
:dbFirebaseStorage="storage"
:userData="userData"
:groupData="companyData"
deleteColor="#3CD291"
/>
</div>
<div v-if="isClick">
<button @click="createDbChatRoom(selectUsersData)" class="test">
{{ 'トークルーム追加' }}
</button>
<CMCSelectUser
:selectedOption="indexCompany"
v-model:modelValue="selectUsersData"
:isMulch="false"
selectColor="#3CD291"
></CMCSelectUser>
</div>
ルーム選択+ルーム作成機能(User情報)
const indexUser =
ref <
Independent >
{
kind: 'independent',
memberIds: [
{ id: 'test1', name: 'テスト太郎' },
{ id: 'test2', name: 'テスト二郎' },
{ id: 'test3', name: 'テスト三郎' },
],
}
autoCreate
[User]:{id:string,name:string}
commonField:createdAt: Date
:updatedAt: Date
:createdBy: Date
:updateBy: Date
+-------------------------------------------+ +----------------------------------+
| ChatUser | | ChatRoomsOverview |
+-------------------------------------------+ +----------------------------------+
| namae: string | | unreadMessageDic: |
| isPublic: boolean | | { |
| avatarUrl: string | | [room:id]: |
| permission: enum | | { |
| notificationSetting: Map<string, boolean> | | unreadCount:number |
| payload: payload: Record<string, any> | | roomId:string |
+-------------------------------------------+ | title:string |
| lastMessageAt:Timestamp |
| iconColor:string |
| iconUrl:string |
| } |
| } |
+----------------------------------+
+-------------------+
| UserGroups |
+-------------------+
| id: string |
| name: string |
| members: [User] |
+-------------------+
+-------------------------+
| ChatRooms |
+-------------------------+
| id: string |
| name: string |
| isReadFunction: boolean |
| isReadFunction: boolean |
| members: [User] |
+-------------------------+
|
|
v
+---------------------------------------------+
| ChatRoom/{roomId}/ |
| messages |
+---------------------------------------------+
| chatMessages: string |
| body: string |
| fileSrc: string |
| fileType: string |
| user: string |
| replyId: string |
| mentionIds: string[] |
| hidden: boolean |
| editHistory: string[] |
| selecterId: string |
| userSelectedId: string |
| replyRequiredDataType: ’’ |’file’ | ‘text’ |
| [key: string]: any |
+---------------------------------------------+
+-----------------------------------------+
| MQAChatSelect |
+-----------------------------------------+
| selectedChoice: Map<string, choiceData> |
| body: string |
| isRoot: boolean |
| isGoal: boolean |
| answerId: string |
+-----------------------------------------+
+-------------------+
| MAnswer |
+-------------------+
| id: string |
| answer: string |
| path: string |
+-------------------+
magnetar 0.13.4 以降推奨
npm i magnetar
firebase 9.20.0 以上推奨
npm install firebase
npm install @codelic/chat-component
修正等
git clone https://github.com/chat-component/~
・magnetar 0.13.4 以降のバージョンのみ対応 ・streage についてはプレーンな Firebase を使用しています ・DBに記載されているコレクション自動生成されます。 ※User,Room,OverView ①ユーザーの初回コンポーネントが呼び出された時 ②ユーザーが任意にRoomを作成した場合 ※Message ①自身がチャットを送信した時 ②チャット相手がチャットを送信した場合
Code-Daiki2170
chat-component is Confidential.
FAQs
@codelic/chat-components(CodelicMagneterChat)
The npm package @codelic/chat-components receives a total of 772 weekly downloads. As such, @codelic/chat-components popularity was classified as not popular.
We found that @codelic/chat-components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.