Skip to content

Commit 4be4ede

Browse files
committed
Added tailwind prefix (comm) to avoid conflicts
1 parent b927f21 commit 4be4ede

File tree

11 files changed

+44
-58
lines changed

11 files changed

+44
-58
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ node_modules
44
.pint.cache
55
.repomix/output
66
.cursor/rules/local.mdc
7+
8+
**/.claude/settings.local.json

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "commentions",
3+
"type": "module",
34
"scripts": {
45
"dev:scripts": "node bin/build.js --dev",
56
"build:scripts": "node bin/build.js",

resources/css/commentions.css

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@import "tailwindcss" source(none);
1+
@import "tailwindcss" prefix(comm) important;
2+
23
@source "../views/";
34
@source "../../src";
45

@@ -17,11 +18,7 @@
1718
}
1819

1920
.tiptap .mention {
20-
background-color: #e5e7eb;
21-
border-radius: 4px;
22-
padding: 2px 4px;
23-
font-weight: bold;
24-
color: #3b82f6;
21+
@apply comm:bg-gray-200 comm:rounded comm:px-1 comm:py-0.5 comm:font-bold comm:text-blue-500;
2522
}
2623

2724
.mention-suggestion {
@@ -40,5 +37,5 @@
4037
}
4138

4239
.mention-item:hover {
43-
background: #f3f4f6;
40+
@apply comm:bg-gray-100;
4441
}

resources/dist/commentions.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/dist/commentions.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/suggestion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const renderSuggestionsComponent = (items) => {
100100
class="mention-item"
101101
x-text="item.name"
102102
@click="add(item)"
103-
:class="{ 'bg-gray-100': $store.filamentCommentsMentionsFiltered.selectedIndex === index }"
103+
:class="{ 'comm:bg-gray-100': $store.filamentCommentsMentionsFiltered.selectedIndex === index }"
104104
></div>
105105
</template>
106106
`;

resources/views/comment-list.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<div @if ($pollingInterval) wire:poll.{{ $pollingInterval }}s @endif>
22
@if ($this->comments->isEmpty())
3-
<div class="flex items-center justify-center p-6 text-center rounded-lg border border-dashed border-gray-300 dark:border-gray-700">
4-
<div class="flex flex-col items-center gap-y-2">
3+
<div class="comm:flex comm:items-center comm:justify-center comm:p-6 comm:text-center comm:rounded-lg comm:border comm:border-dashed comm:border-gray-300 comm:dark:border-gray-700">
4+
<div class="comm:flex comm:flex-col comm:items-center comm:gap-y-2">
55
<x-filament::icon
66
icon="heroicon-o-chat-bubble-left-right"
7-
class="w-8 h-8 text-gray-400 dark:text-gray-500"
7+
class="comm:w-8 comm:h-8 comm:text-gray-400 comm:dark:text-gray-500"
88
/>
99

10-
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">
10+
<span class="comm:text-sm comm:font-medium comm:text-gray-500 comm:dark:text-gray-400">
1111
No comments yet.
1212
</span>
1313
</div>

resources/views/comment.blade.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
@use('\Kirschbaum\Commentions\Config')
22

3-
<div class="flex items-start gap-x-4 border p-4 rounded-lg shadow-sm mb-2" id="filament-comment-{{ $comment->getId() }}">
3+
<div class="comm:flex comm:items-start comm:gap-x-4 comm:border comm:p-4 comm:rounded-lg comm:shadow-sm comm:mb-2" id="filament-comment-{{ $comment->getId() }}">
44
@if ($avatar = $comment->getAuthorAvatar())
55
<img
66
src="{{ $comment->getAuthorAvatar() }}"
77
alt="User Avatar"
8-
class="w-10 h-10 rounded-full mt-0.5 object-cover object-center"
8+
class="comm:w-10 comm:h-10 comm:rounded-full comm:mt-0.5 comm:object-cover comm:object-center"
99
/>
1010
@else
11-
<div class="w-10 h-10 rounded-full mt-0.5 "></div>
11+
<div class="comm:w-10 comm:h-10 comm:rounded-full comm:mt-0.5 "></div>
1212
@endif
1313

14-
<div class="flex-1">
15-
<div class="text-sm font-bold text-gray-900 dark:text-gray-100 flex justify-between items-center">
14+
<div class="comm:flex-1">
15+
<div class="comm:text-sm comm:font-bold comm:text-gray-900 comm:dark:text-gray-100 comm:flex comm:justify-between comm:items-center">
1616
<div>
1717
{{ $comment->getAuthorName() }}
1818
<span
19-
class="text-xs text-gray-500 dark:text-gray-300"
19+
class="comm:text-xs comm:text-gray-500 comm:dark:text-gray-300"
2020
title="Commented at {{ $comment->getCreatedAt()->format('Y-m-d H:i:s') }}"
2121
>{{ $comment->getCreatedAt()->diffForHumans() }}</span>
2222

2323
@if ($comment->getUpdatedAt()->gt($comment->getCreatedAt()))
2424
<span
25-
class="text-xs text-gray-300 ml-1"
25+
class="comm:text-xs comm:text-gray-300 comm:ml-1"
2626
title="Edited at {{ $comment->getUpdatedAt()->format('Y-m-d H:i:s') }}"
2727
>(edited)</span>
2828
@endif
2929

3030
@if ($comment->getLabel())
31-
<span class="text-xs text-gray-500 dark:text-gray-300 bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded-md">
31+
<span class="comm:text-xs comm:text-gray-500 comm:dark:text-gray-300 comm:bg-gray-100 comm:dark:bg-gray-800 comm:px-1.5 comm:py-0.5 comm:rounded-md">
3232
{{ $comment->getLabel() }}
3333
</span>
3434
@endif
3535
</div>
3636

3737
@if ($comment->isComment() && Config::resolveAuthenticatedUser()?->canAny(['update', 'delete'], $comment))
38-
<div class="flex gap-x-1">
38+
<div class="comm:flex comm:gap-x-1">
3939
@if (Config::resolveAuthenticatedUser()?->can('update', $comment))
4040
<x-filament::icon-button
4141
icon="heroicon-s-pencil-square"
@@ -58,14 +58,14 @@ class="text-xs text-gray-300 ml-1"
5858
</div>
5959

6060
@if ($editing)
61-
<div class="mt-2">
62-
<div class="tip-tap-container mb-2" wire:ignore>
61+
<div class="comm:mt-2">
62+
<div class="tip-tap-container comm:mb-2" wire:ignore>
6363
<div x-data="editor(@js($commentBody), @js($mentionables), 'comment')">
6464
<div x-ref="element"></div>
6565
</div>
6666
</div>
6767

68-
<div class="flex gap-x-2">
68+
<div class="comm:flex comm:gap-x-2">
6969
<x-filament::button
7070
wire:click="updateComment({{ $comment->getId() }})"
7171
size="sm"
@@ -83,7 +83,7 @@ class="text-xs text-gray-300 ml-1"
8383
</div>
8484
</div>
8585
@else
86-
<div class="mt-1 space-y-6 text-sm text-gray-800 dark:text-gray-200">{!! $comment->getParsedBody() !!}</div>
86+
<div class="comm:mt-1 comm:space-y-6 comm:text-sm comm:text-gray-800 comm:dark:text-gray-200">{!! $comment->getParsedBody() !!}</div>
8787

8888
@if ($comment->isComment())
8989
<livewire:commentions::reactions
@@ -104,12 +104,12 @@ class="text-xs text-gray-300 ml-1"
104104
Delete Comment
105105
</x-slot>
106106

107-
<div class="py-4">
107+
<div class="comm:py-4">
108108
Are you sure you want to delete this comment? This action cannot be undone.
109109
</div>
110110

111111
<x-slot name="footer">
112-
<div class="flex justify-end gap-x-4">
112+
<div class="comm:flex comm:justify-end comm:gap-x-4">
113113
<x-filament::button
114114
wire:click="$dispatch('close-modal', { id: 'delete-comment-modal-{{ $comment->getId() }}' })"
115115
color="gray"

resources/views/comments.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
@use('\Kirschbaum\Commentions\Config')
22

3-
<div class="space-y-2" x-data="{ wasFocused: false }">
3+
<div class="comm:space-y-2" x-data="{ wasFocused: false }">
44
@if (Config::resolveAuthenticatedUser()?->can('create', Config::getCommentModel()))
55
<form wire:submit.prevent="save" x-cloak>
66
{{-- tiptap editor --}}
7-
<div class="relative tip-tap-container mb-2" x-on:click="wasFocused = true" wire:ignore>
7+
<div class="comm:relative tip-tap-container comm:mb-2" x-on:click="wasFocused = true" wire:ignore>
88
<div
99
x-data="editor(@js($commentBody), @js($this->mentions), 'comments')"
1010
>

resources/views/reactions.blade.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<div class="relative mt-2 pt-2 border-t border-gray-200 dark:border-gray-700 flex items-center gap-x-1 flex-wrap">
1+
<div class="comm:relative comm:mt-2 comm:pt-2 comm:border-t comm:border-gray-200 comm:dark:border-gray-700 comm:flex comm:items-center comm:gap-x-1 comm:flex-wrap">
22
{{-- Inline buttons for existing reactions --}}
33
@foreach ($this->reactionSummary as $reactionData)
44
<span wire:key="inline-reaction-button-{{ $reactionData['reaction'] }}-{{ $comment->getId() }}">
55
<button
66
x-cloak
77
wire:click="handleReactionToggle('{{ $reactionData['reaction'] }}')"
88
type="button"
9-
class="inline-flex items-center justify-center gap-1 rounded-full border px-2 h-8 text-sm font-medium transition focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed
9+
class="comm:inline-flex comm:items-center comm:justify-center comm:gap-1 comm:rounded-full comm:border comm:px-2 comm:h-8 comm:text-sm comm:font-medium comm:transition comm:focus:outline-none comm:focus:ring-2 comm:focus:ring-offset-2 comm:disabled:opacity-50 comm:disabled:cursor-not-allowed
1010
{{ $reactionData['reacted_by_current_user']
11-
? 'bg-primary-100 dark:bg-primary-800 border-primary-300 dark:border-primary-600 text-primary-700 dark:text-primary-200 hover:bg-primary-200 dark:hover:bg-primary-600'
12-
: 'bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600' }}"
11+
? 'comm:bg-gray-50 comm:dark:bg-gray-800 comm:border-gray-300 comm:dark:border-gray-600 comm:text-gray-700 comm:dark:text-gray-200 comm:hover:bg-gray-200 comm:dark:hover:bg-gray-600'
12+
: 'comm:bg-white comm:dark:bg-gray-900 comm:border-gray-300 comm:dark:border-gray-600 comm:text-gray-700 comm:dark:text-gray-200 comm:hover:bg-gray-100 comm:dark:hover:bg-gray-600' }}"
1313
title="{{ $reactionData['reaction'] }}"
1414

1515
>
@@ -20,16 +20,16 @@ class="inline-flex items-center justify-center gap-1 rounded-full border px-2 h-
2020
@endforeach
2121

2222
{{-- Add Reaction Button --}}
23-
<div class="relative" x-data="{ open: false }" wire:ignore.self>
23+
<div class="comm:relative" x-data="{ open: false }" wire:ignore.self>
2424
<button
2525
x-on:click="open = !open"
2626
type="button"
2727
@disabled(! auth()->check())
28-
class="inline-flex items-center justify-center gap-1 rounded-full border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 w-8 h-8 text-sm font-medium text-gray-700 dark:text-gray-200 transition hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed"
28+
class="comm:inline-flex comm:items-center comm:justify-center comm:gap-1 comm:rounded-full comm:border comm:border-gray-300 comm:dark:border-gray-600 comm:bg-white comm:dark:bg-gray-900 comm:w-8 comm:h-8 comm:text-sm comm:font-medium comm:text-gray-700 comm:dark:text-gray-200 comm:transition comm:hover:bg-gray-100 comm:dark:hover:bg-gray-700 comm:focus:outline-none comm:focus:ring-2 comm:focus:ring-offset-2 comm:disabled:opacity-50 comm:disabled:cursor-not-allowed"
2929
title="Add Reaction"
3030
wire:key="add-reaction-button-{{ $comment->getId() }}"
3131
>
32-
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
32+
<svg xmlns="http://www.w3.org/2000/svg" class="comm:h-4 comm:w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
3333
<path stroke-linecap="round" stroke-linejoin="round" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
3434
</svg>
3535
</button>
@@ -39,7 +39,8 @@ class="inline-flex items-center justify-center gap-1 rounded-full border border-
3939
x-show="open"
4040
x-cloak
4141
x-on:click.away="open = false"
42-
class="absolute bottom-full mb-2 z-10 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg shadow-lg p-2 flex flex-wrap gap-1 w-max max-w-xs"
42+
class="comm:absolute comm:bottom-full comm:mb-2 comm:z-10 comm:bg-white comm:dark:bg-gray-800 comm:border comm:border-gray-300 comm:dark:border-gray-600 comm:rounded-lg comm:shadow-lg comm:p-2 comm:flex-wrap comm:gap-1 comm:w-max comm:max-w-xs"
43+
:class="{ 'comm:hidden': ! open, 'comm:flex': open }"
4344
>
4445
@foreach ($allowedReactions as $reactionEmoji)
4546
@php
@@ -51,10 +52,10 @@ class="absolute bottom-full mb-2 z-10 bg-white dark:bg-gray-800 border border-gr
5152
x-on:click="open = false"
5253
type="button"
5354
@disabled(! auth()->check())
54-
class="inline-flex items-center justify-center gap-1 rounded-full border w-8 h-8 text-sm font-medium transition focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed
55+
class="comm:inline-flex comm:items-center comm:justify-center comm:gap-1 comm:rounded-full comm:w-8 comm:h-8 comm:text-sm comm:font-medium comm:transition comm:focus:outline-none comm:focus:ring-2 comm:focus:ring-offset-2 comm:disabled:opacity-50 comm:disabled:cursor-not-allowed
5556
{{ $reactionData['reacted_by_current_user']
56-
? 'bg-primary-100 dark:bg-primary-800 border-primary-300 dark:border-primary-600 text-primary-700 dark:text-primary-200 hover:bg-primary-200 dark:hover:bg-primary-600'
57-
: 'bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600' }}"
57+
? 'comm:text-gray-700 comm:dark:text-gray-200 comm:hover:bg-gray-200 comm:dark:hover:bg-gray-600'
58+
: 'comm:text-gray-700 comm:dark:text-gray-200 comm:hover:bg-gray-100 comm:dark:hover:bg-gray-600' }}"
5859
title="{{ $reactionEmoji }}"
5960
wire:key="popup-reaction-button-{{ $reactionEmoji }}-{{ $comment->getId() }}"
6061
>
@@ -69,7 +70,7 @@ class="inline-flex items-center justify-center gap-1 rounded-full border w-8 h-8
6970
@if (! in_array($reactionEmoji, $allowedReactions) && $data['count'] > 0)
7071
<span
7172
wire:key="reaction-extra-{{ $reactionEmoji }}-{{ $comment->getId() }}"
72-
class="inline-flex items-center justify-center gap-1 rounded-full border border-gray-300 dark:border-gray-600 bg-gray-100 dark:bg-gray-800 px-2 h-8 text-sm font-medium text-gray-600 dark:text-gray-300"
73+
class="comm:inline-flex comm:items-center comm:justify-center comm:gap-1 comm:rounded-full comm:border comm:border-gray-300 comm:dark:border-gray-600 comm:bg-gray-100 comm:dark:bg-gray-800 comm:px-2 comm:h-8 comm:text-sm comm:font-medium comm:text-gray-600 comm:dark:text-gray-300"
7374
title="{{ $reactionEmoji }}"
7475
>
7576
<span>{{ $reactionEmoji }}</span>

0 commit comments

Comments
 (0)