Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -374,87 +374,7 @@
{% endif %}
</div>

{# Remote assets sidebar - only show if project has manifest URLs configured #}
{% if hasRemoteAssets %}
<div class="mt-6 2xl:mt-0 2xl:w-[35%] 2xl:max-w-md 2xl:sticky 2xl:top-4 flex-shrink-0"
{{ stimulus_controller('remote-asset-browser', {
fetchUrl: path('remote_content_assets.presentation.list', { projectId: project.id }),
windowSize: remoteAssetBrowserWindowSize,
addToChatLabel: 'remote_content_assets.browser_add_to_chat'|trans,
openInNewTabLabel: 'remote_content_assets.browser_open_in_new_tab'|trans,
uploadUrl: project.hasS3UploadConfigured() ? path('remote_content_assets.presentation.upload', { projectId: project.id }) : '',
uploadCsrfToken: project.hasS3UploadConfigured() ? csrf_token('remote_asset_upload') : '',
workspaceId: workspace.id
}) }}
{{ stimulus_action('chat-based-content-editor', 'handleAssetInsert', 'remote-asset-browser:insert') }}
{{ stimulus_action('chat-based-content-editor', 'handleUploadComplete', 'remote-asset-browser:uploadComplete') }}>
{# On narrow screens: border-top separator. On wide screens: left border #}
<div class="border-t 2xl:border-t-0 2xl:border-l border-dark-200 dark:border-dark-700 pt-6 2xl:pt-0 2xl:pl-6">
<div class="flex items-center gap-2 mb-3">
<h2 class="text-lg font-medium text-dark-900 dark:text-dark-100">
{{ 'remote_content_assets.browser_title'|trans }}
</h2>
<span {{ stimulus_target('remote-asset-browser', 'count') }}
class="text-sm text-dark-500 dark:text-dark-400"></span>
</div>

{# Upload dropzone - only show if S3 is configured #}
{% if project.hasS3UploadConfigured() %}
<div {{ stimulus_target('remote-asset-browser', 'dropzone') }}
class="border-2 border-dashed border-dark-300 dark:border-dark-600 rounded-lg p-4 text-center transition-colors">
<svg class="w-8 h-8 mx-auto text-dark-400 dark:text-dark-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" />
</svg>
<p class="mt-1 text-sm text-dark-500 dark:text-dark-400">{{ 'remote_content_assets.browser_upload_dropzone'|trans }}</p>
<p class="text-xs text-dark-400 dark:text-dark-500">{{ 'remote_content_assets.browser_upload_hint'|trans }}</p>
</div>
{# Upload progress indicator #}
<div {{ stimulus_target('remote-asset-browser', 'uploadProgress') }}
class="hidden mt-3 flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400">
<svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
<span>{{ 'remote_content_assets.browser_uploading'|trans }}</span>
</div>
{# Upload success message #}
<div {{ stimulus_target('remote-asset-browser', 'uploadSuccess') }}
class="hidden mt-3 flex items-center gap-2 text-sm text-green-600 dark:text-green-400">
<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd" />
</svg>
<span>{{ 'remote_content_assets.browser_upload_success'|trans }}</span>
</div>
{# Upload error message #}
<div {{ stimulus_target('remote-asset-browser', 'uploadError') }}
class="hidden mt-3 flex items-center gap-2 text-sm text-red-600 dark:text-red-400">
<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z" clip-rule="evenodd" />
</svg>
<span data-error-text>{{ 'remote_content_assets.browser_upload_error'|trans }}</span>
</div>
{% endif %}

<div class="{{ project.hasS3UploadConfigured() ? 'mt-3' : '' }}">
<input type="text"
{{ stimulus_target('remote-asset-browser', 'search') }}
{{ stimulus_action('remote-asset-browser', 'filter', 'input') }}
placeholder="{{ 'remote_content_assets.browser_search_placeholder'|trans }}"
class="w-full px-3 py-1.5 text-sm border border-dark-300 dark:border-dark-600 rounded-md bg-white dark:bg-dark-800 text-dark-900 dark:text-dark-100 placeholder-dark-400 dark:placeholder-dark-500 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500">
</div>
<div {{ stimulus_target('remote-asset-browser', 'loading') }}
class="py-4 text-center text-dark-500 dark:text-dark-400">
{{ 'common.loading'|trans }}
</div>
<div {{ stimulus_target('remote-asset-browser', 'empty') }}
class="py-4 text-center text-dark-500 dark:text-dark-400 hidden">
{{ 'remote_content_assets.browser_empty'|trans }}
</div>
<div {{ stimulus_target('remote-asset-browser', 'list') }}
class="mt-3"></div>
</div>
</div>
{% endif %}
{% include '@chat_based_content_editor.presentation/remote_asset_area.twig' %}
</div>

{# Info section with cross-links - subtle placement at bottom #}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{# Remote assets sidebar - only show if project has manifest URLs configured #}
{% if hasRemoteAssets %}
<div class="mt-6 2xl:mt-0 2xl:w-[35%] 2xl:max-w-md 2xl:sticky 2xl:top-4 flex-shrink-0"
{{ stimulus_controller('remote-asset-browser', {
fetchUrl: path('remote_content_assets.presentation.list', { projectId: project.id }),
windowSize: remoteAssetBrowserWindowSize,
addToChatLabel: 'remote_content_assets.browser_add_to_chat'|trans,
openInNewTabLabel: 'remote_content_assets.browser_open_in_new_tab'|trans,
uploadUrl: project.hasS3UploadConfigured() ? path('remote_content_assets.presentation.upload', { projectId: project.id }) : '',
uploadCsrfToken: project.hasS3UploadConfigured() ? csrf_token('remote_asset_upload') : '',
workspaceId: workspace.id
}) }}
{{ stimulus_action('chat-based-content-editor', 'handleAssetInsert', 'remote-asset-browser:insert') }}
{{ stimulus_action('chat-based-content-editor', 'handleUploadComplete', 'remote-asset-browser:uploadComplete') }}>
{# On narrow screens: border-top separator. On wide screens: left border #}
<div class="border-t 2xl:border-t-0 2xl:border-l border-dark-200 dark:border-dark-700 pt-6 2xl:pt-0 2xl:pl-6">
<div class="flex items-center gap-2 mb-3">
<h2 class="text-lg font-medium text-dark-900 dark:text-dark-100">
{{ 'remote_content_assets.browser_title'|trans }}
</h2>
<span {{ stimulus_target('remote-asset-browser', 'count') }}
class="text-sm text-dark-500 dark:text-dark-400"></span>
</div>

{# Upload dropzone - only show if S3 is configured #}
{% if project.hasS3UploadConfigured() %}
<div {{ stimulus_target('remote-asset-browser', 'dropzone') }}
{{ stimulus_action('remote-asset-browser', 'openFileDialog', 'click') }}
class="border-2 border-dashed border-dark-300 dark:border-dark-600 rounded-lg p-4 text-center transition-colors cursor-pointer hover:border-primary-400 dark:hover:border-primary-500">
<svg class="w-8 h-8 mx-auto text-dark-400 dark:text-dark-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" />
</svg>
<p class="mt-1 text-sm text-dark-500 dark:text-dark-400">{{ 'remote_content_assets.browser_upload_dropzone'|trans }}</p>
<p class="text-xs text-dark-400 dark:text-dark-500">{{ 'remote_content_assets.browser_upload_hint'|trans }}</p>
</div>
{# Hidden file input for click-to-upload #}
<input type="file"
multiple
accept="image/jpeg,image/png,image/gif,image/webp,image/svg+xml,image/avif"
{{ stimulus_target('remote-asset-browser', 'fileInput') }}
{{ stimulus_action('remote-asset-browser', 'handleFileSelect', 'change') }}
class="hidden">
{# Upload progress indicator #}
<div {{ stimulus_target('remote-asset-browser', 'uploadProgress') }}
class="hidden mt-3 flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400">
<svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
<span>{{ 'remote_content_assets.browser_uploading'|trans }}</span>
<span {{ stimulus_target('remote-asset-browser', 'uploadProgressText') }}></span>
</div>
{# Upload success message #}
<div {{ stimulus_target('remote-asset-browser', 'uploadSuccess') }}
class="hidden mt-3 flex items-center gap-2 text-sm text-green-600 dark:text-green-400">
<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd" />
</svg>
<span>{{ 'remote_content_assets.browser_upload_success'|trans }}</span>
</div>
{# Upload error message #}
<div {{ stimulus_target('remote-asset-browser', 'uploadError') }}
class="hidden mt-3 flex items-center gap-2 text-sm text-red-600 dark:text-red-400">
<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z" clip-rule="evenodd" />
</svg>
<span data-error-text>{{ 'remote_content_assets.browser_upload_error'|trans }}</span>
</div>
{% endif %}

<div class="{{ project.hasS3UploadConfigured() ? 'mt-3' : '' }}">
<input type="text"
{{ stimulus_target('remote-asset-browser', 'search') }}
{{ stimulus_action('remote-asset-browser', 'filter', 'input') }}
placeholder="{{ 'remote_content_assets.browser_search_placeholder'|trans }}"
class="w-full px-3 py-1.5 text-sm border border-dark-300 dark:border-dark-600 rounded-md bg-white dark:bg-dark-800 text-dark-900 dark:text-dark-100 placeholder-dark-400 dark:placeholder-dark-500 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500">
</div>
<div {{ stimulus_target('remote-asset-browser', 'loading') }}
class="py-4 text-center text-dark-500 dark:text-dark-400">
{{ 'common.loading'|trans }}
</div>
<div {{ stimulus_target('remote-asset-browser', 'empty') }}
class="py-4 text-center text-dark-500 dark:text-dark-400 hidden">
{{ 'remote_content_assets.browser_empty'|trans }}
</div>
<div {{ stimulus_target('remote-asset-browser', 'list') }}
class="mt-3"></div>
</div>
</div>
{% endif %}
Loading