mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 06:42:32 -05:00
add native titles
This commit is contained in:
1 parent
aa1874cdb4
commit
617d75a4ed
28 files changed
+82
-13
No files matched your search
@@ -9,6 +9,8 @@ import ToggleVisible from './elements/toggle_visible'
|
|||||||
import ToggleCookies from './elements/toggle_cookies'
|
import ToggleCookies from './elements/toggle_cookies'
|
||||||
import DisableHidden from './elements/disable_hidden'
|
import DisableHidden from './elements/disable_hidden'
|
||||||
import TurboModal from './elements/turbo_modal'
|
import TurboModal from './elements/turbo_modal'
|
||||||
|
import NativeAction from './elements/native_action'
|
||||||
|
import NativeHeader from './elements/native_header'
|
||||||
import FileDropzone from './elements/file_dropzone'
|
import FileDropzone from './elements/file_dropzone'
|
||||||
import MenuActive from './elements/menu_active'
|
import MenuActive from './elements/menu_active'
|
||||||
import ClipboardCopy from './elements/clipboard_copy'
|
import ClipboardCopy from './elements/clipboard_copy'
|
||||||
@@ -106,6 +108,8 @@ const safeRegisterElement = (name, element, options = {}) => !window.customEleme
|
|||||||
safeRegisterElement('toggle-visible', ToggleVisible)
|
safeRegisterElement('toggle-visible', ToggleVisible)
|
||||||
safeRegisterElement('disable-hidden', DisableHidden)
|
safeRegisterElement('disable-hidden', DisableHidden)
|
||||||
safeRegisterElement('turbo-modal', TurboModal)
|
safeRegisterElement('turbo-modal', TurboModal)
|
||||||
|
safeRegisterElement('native-action', NativeAction)
|
||||||
|
safeRegisterElement('native-header', NativeHeader)
|
||||||
safeRegisterElement('file-dropzone', FileDropzone)
|
safeRegisterElement('file-dropzone', FileDropzone)
|
||||||
safeRegisterElement('menu-active', MenuActive)
|
safeRegisterElement('menu-active', MenuActive)
|
||||||
safeRegisterElement('clipboard-copy', ClipboardCopy)
|
safeRegisterElement('clipboard-copy', ClipboardCopy)
|
||||||
|
|||||||
@@ -166,3 +166,8 @@ button[disabled] .enabled, button.btn-disabled .enabled {
|
|||||||
markdown-editor [contenteditable] p {
|
markdown-editor [contenteditable] p {
|
||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
native-action,
|
||||||
|
native-header {
|
||||||
|
display: contents;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
let counter = 0
|
||||||
|
|
||||||
|
export default class extends HTMLElement {
|
||||||
|
connectedCallback () {
|
||||||
|
const bridge = window.webkit?.messageHandlers?.native
|
||||||
|
|
||||||
|
if (!bridge) return
|
||||||
|
|
||||||
|
const target = this.querySelector('a, button, [role="button"]')
|
||||||
|
|
||||||
|
if (!target) return
|
||||||
|
|
||||||
|
this.nativeId ||= `native-action-${++counter}`
|
||||||
|
target.dataset.nativeId = this.nativeId
|
||||||
|
|
||||||
|
bridge.postMessage({
|
||||||
|
type: 'action',
|
||||||
|
op: 'add',
|
||||||
|
id: this.nativeId,
|
||||||
|
title: this.dataset.label || target.textContent.trim(),
|
||||||
|
icon: this.dataset.icon,
|
||||||
|
placement: this.dataset.placement || 'menu'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnectedCallback () {
|
||||||
|
if (this.nativeId) {
|
||||||
|
window.webkit?.messageHandlers?.native?.postMessage({ type: 'action', op: 'remove', id: this.nativeId })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
export default class extends HTMLElement {
|
||||||
|
connectedCallback () {
|
||||||
|
window.webkit?.messageHandlers?.native?.postMessage({
|
||||||
|
type: 'header',
|
||||||
|
op: 'add',
|
||||||
|
title: this.dataset.label || this.querySelector('h1')?.textContent?.trim() || '',
|
||||||
|
search: 'search' in this.dataset
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnectedCallback () {
|
||||||
|
window.webkit?.messageHandlers?.native?.postMessage({ type: 'header', op: 'remove' })
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('account')) if turbo_native_app? %>
|
||||||
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="flex-grow max-w-xl mx-auto">
|
<div class="flex-grow max-w-xl mx-auto">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, 'API') if turbo_native_app? %>
|
||||||
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-10">
|
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-10">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="flex-grow">
|
<div class="flex-grow">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('email')) if turbo_native_app? %>
|
||||||
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="flex-grow max-w-xl mx-auto min-w-0">
|
<div class="flex-grow max-w-xl mx-auto min-w-0">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('e_signature')) if turbo_native_app? %>
|
||||||
<div class="flex-wrap space-y-4 md:flex md:flex-nowrap md:space-y-0 md:space-x-10">
|
<div class="flex-wrap space-y-4 md:flex md:flex-nowrap md:space-y-0 md:space-x-10">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="md:flex-grow">
|
<div class="md:flex-grow">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<title>
|
<title>
|
||||||
<%= content_for(:html_title) || (turbo_native_app? ? '' : (signed_in? ? 'DocuSeal' : 'DocuSeal | Open Source Document Signing')) %>
|
<%= content_for(:native_title) || content_for(:html_title) || (signed_in? ? 'DocuSeal' : 'DocuSeal | Open Source Document Signing') %>
|
||||||
</title>
|
</title>
|
||||||
<%= render 'shared/meta' %>
|
<%= render 'shared/meta' %>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, 'MCP') if turbo_native_app? %>
|
||||||
<div class="flex-wrap space-y-4 md:flex md:flex-nowrap md:space-y-0 md:space-x-10">
|
<div class="flex-wrap space-y-4 md:flex md:flex-nowrap md:space-y-0 md:space-x-10">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="md:flex-grow">
|
<div class="md:flex-grow">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('notifications')) if turbo_native_app? %>
|
||||||
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="flex-grow max-w-xl mx-auto">
|
<div class="flex-grow max-w-xl mx-auto">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('personalization')) if turbo_native_app? %>
|
||||||
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="flex-grow max-w-xl mx-auto">
|
<div class="flex-grow max-w-xl mx-auto">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('profile')) if turbo_native_app? %>
|
||||||
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="flex-grow max-w-xl mx-auto">
|
<div class="flex-grow max-w-xl mx-auto">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('settings')) if turbo_native_app? %>
|
||||||
<% unless turbo_native_app? %>
|
<% unless turbo_native_app? %>
|
||||||
<div class="mb-2 w-full">
|
<div class="mb-2 w-full">
|
||||||
<a href="<%= root_path %>" class="flex items-center space-x-0.5 font-medium">
|
<a href="<%= root_path %>" class="flex items-center space-x-0.5 font-medium">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, 'SMS') if turbo_native_app? %>
|
||||||
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="flex-grow max-w-xl mx-auto">
|
<div class="flex-grow max-w-xl mx-auto">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, 'SSO') if turbo_native_app? %>
|
||||||
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="flex-grow max-w-xl mx-auto">
|
<div class="flex-grow max-w-xl mx-auto">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('storage')) if turbo_native_app? %>
|
||||||
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="flex-grow max-w-xl mx-auto">
|
<div class="flex-grow max-w-xl mx-auto">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, @submission.name || @submission.template&.name) if turbo_native_app? %>
|
||||||
<% if local_assigns[:is_preview] %>
|
<% if local_assigns[:is_preview] %>
|
||||||
<%= render 'submissions/preview_tags' %>
|
<%= render 'submissions/preview_tags' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('archived')) if turbo_native_app? %>
|
||||||
<% filter_params = params.permit(Submissions::Filter::ALLOWED_PARAMS).compact_blank %>
|
<% filter_params = params.permit(Submissions::Filter::ALLOWED_PARAMS).compact_blank %>
|
||||||
<% unless turbo_native_app? %>
|
<% unless turbo_native_app? %>
|
||||||
<div>
|
<div>
|
||||||
@@ -8,9 +9,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="flex flex-col md:flex-row md:items-center mb-4 gap-3">
|
<div class="flex flex-col md:flex-row md:items-center mb-4 gap-3">
|
||||||
<% if turbo_native_app? %>
|
<% unless turbo_native_app? %>
|
||||||
<% content_for(:html_title, t('archived')) %>
|
|
||||||
<% else %>
|
|
||||||
<div class="group/header flex w-full justify-between items-center">
|
<div class="group/header flex w-full justify-between items-center">
|
||||||
<div class="max-md:group-has-[search-input:focus-within]/header:hidden">
|
<div class="max-md:group-has-[search-input:focus-within]/header:hidden">
|
||||||
<h1 class="text-2xl md:text-3xl font-bold md:block <%= 'hidden' if params[:q].present? %>"><%= t('submissions') %> <span class="badge badge-outline badge-lg align-middle"><%= t('archived') %></span></h1>
|
<h1 class="text-2xl md:text-3xl font-bold md:block <%= 'hidden' if params[:q].present? %>"><%= t('submissions') %> <span class="badge badge-outline badge-lg align-middle"><%= t('archived') %></span></h1>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, @template_folder.name) if turbo_native_app? %>
|
||||||
<% unless turbo_native_app? %>
|
<% unless turbo_native_app? %>
|
||||||
<div>
|
<div>
|
||||||
<%= link_to @template_folder.parent_folder ? folder_path(@template_folder.parent_folder) : root_path, class: 'flex items-center' do %>
|
<%= link_to @template_folder.parent_folder ? folder_path(@template_folder.parent_folder) : root_path, class: 'flex items-center' do %>
|
||||||
@@ -13,9 +14,7 @@
|
|||||||
<button type="submit"></button>
|
<button type="submit"></button>
|
||||||
<input id="dashboard_dropzone_input" name="files[]" type="file" multiple>
|
<input id="dashboard_dropzone_input" name="files[]" type="file" multiple>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if turbo_native_app? %>
|
<% unless turbo_native_app? %>
|
||||||
<% content_for(:html_title, @template_folder.name) %>
|
|
||||||
<% else %>
|
|
||||||
<div class="group/header relative flex justify-between items-center w-full mb-4">
|
<div class="group/header relative flex justify-between items-center w-full mb-4">
|
||||||
<%= render 'templates/dashboard_dropzone', style: 'height: 137px' %>
|
<%= render 'templates/dashboard_dropzone', style: 'height: 137px' %>
|
||||||
<% unless @template_folder.parent_folder %>
|
<% unless @template_folder.parent_folder %>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, @template.name) if turbo_native_app? %>
|
||||||
<% if !turbo_native_app? && (current_user.created_at > 2.weeks.ago || params[:tour] == 'true') %>
|
<% if !turbo_native_app? && (current_user.created_at > 2.weeks.ago || params[:tour] == 'true') %>
|
||||||
<% user_config = current_user.user_configs.find_or_initialize_by(key: UserConfig::SHOW_APP_TOUR) %>
|
<% user_config = current_user.user_configs.find_or_initialize_by(key: UserConfig::SHOW_APP_TOUR) %>
|
||||||
<% @show_tour_start_form = user_config.new_record? && !params.key?(:tour) %>
|
<% @show_tour_start_form = user_config.new_record? && !params.key?(:tour) %>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, @template.name) if turbo_native_app? %>
|
||||||
<%= render 'title', template: @template %>
|
<%= render 'title', template: @template %>
|
||||||
<% filter_params = params.permit(Submissions::Filter::ALLOWED_PARAMS).compact_blank %>
|
<% filter_params = params.permit(Submissions::Filter::ALLOWED_PARAMS).compact_blank %>
|
||||||
<% is_show_tabs = @pagy.pages > 1 || params[:q].present? || params[:status].present? || filter_params.present? %>
|
<% is_show_tabs = @pagy.pages > 1 || params[:q].present? || params[:status].present? || filter_params.present? %>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('archived')) if turbo_native_app? %>
|
||||||
<% unless turbo_native_app? %>
|
<% unless turbo_native_app? %>
|
||||||
<div>
|
<div>
|
||||||
<%= link_to root_path, class: 'flex items-center mb-1 md:mb-0' do %>
|
<%= link_to root_path, class: 'flex items-center mb-1 md:mb-0' do %>
|
||||||
@@ -6,9 +7,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if turbo_native_app? %>
|
<% unless turbo_native_app? %>
|
||||||
<% content_for(:html_title, t('archived')) %>
|
|
||||||
<% else %>
|
|
||||||
<div class="group/header flex justify-between mb-4 items-center">
|
<div class="group/header flex justify-between mb-4 items-center">
|
||||||
<div class="max-md:group-has-[search-input:focus-within]/header:hidden">
|
<div class="max-md:group-has-[search-input:focus-within]/header:hidden">
|
||||||
<h1 class="text-2xl md:text-3xl font-bold md:block <%= 'hidden' if params[:q].present? %>"><%= t('document_templates_html') %> <span class="badge badge-outline badge-lg align-middle"><%= t('archived') %></span></h1>
|
<h1 class="text-2xl md:text-3xl font-bold md:block <%= 'hidden' if params[:q].present? %>"><%= t('document_templates_html') %> <span class="badge badge-outline badge-lg align-middle"><%= t('archived') %></span></h1>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, @template.name) if turbo_native_app? %>
|
||||||
<% filter_params = params.permit(Submissions::Filter::ALLOWED_PARAMS).compact_blank %>
|
<% filter_params = params.permit(Submissions::Filter::ALLOWED_PARAMS).compact_blank %>
|
||||||
<% with_filters = @pagy.pages > 1 || params[:q].present? || filter_params.present? %>
|
<% with_filters = @pagy.pages > 1 || params[:q].present? || filter_params.present? %>
|
||||||
<%= render 'templates/title', template: @template %>
|
<%= render 'templates/title', template: @template %>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('shared').capitalize) if turbo_native_app? %>
|
||||||
<% unless turbo_native_app? %>
|
<% unless turbo_native_app? %>
|
||||||
<div>
|
<div>
|
||||||
<%= link_to(@is_archived ? templates_shared_index_path : root_path, class: 'flex items-center mb-1 md:mb-0') do %>
|
<%= link_to(@is_archived ? templates_shared_index_path : root_path, class: 'flex items-center mb-1 md:mb-0') do %>
|
||||||
@@ -6,9 +7,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if turbo_native_app? %>
|
<% unless turbo_native_app? %>
|
||||||
<% content_for(:html_title, t('shared').capitalize) %>
|
|
||||||
<% else %>
|
|
||||||
<div class="group/header relative flex justify-between items-center w-full mb-4">
|
<div class="group/header relative flex justify-between items-center w-full mb-4">
|
||||||
<h1 class="text-2xl truncate md:text-3xl font-bold flex items-center flex-grow min-w-0 space-x-2 md:flex max-md:group-has-[search-input:focus-within]/header:hidden <%= 'hidden' if params[:q].present? %>">
|
<h1 class="text-2xl truncate md:text-3xl font-bold flex items-center flex-grow min-w-0 space-x-2 md:flex max-md:group-has-[search-input:focus-within]/header:hidden <%= 'hidden' if params[:q].present? %>">
|
||||||
<%= svg_icon('folder', class: 'w-9 h-9 flex-shrink-0') %>
|
<%= svg_icon('folder', class: 'w-9 h-9 flex-shrink-0') %>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('users')) if turbo_native_app? %>
|
||||||
<div class="flex-wrap space-y-4 md:flex md:flex-nowrap md:space-y-0 md:space-x-10">
|
<div class="flex-wrap space-y-4 md:flex md:flex-nowrap md:space-y-0 md:space-x-10">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="md:flex-grow">
|
<div class="md:flex-grow">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, t('webhooks')) if turbo_native_app? %>
|
||||||
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-10">
|
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-10">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="flex-grow min-w-0">
|
<div class="flex-grow min-w-0">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% content_for(:native_title, 'Webhook') if turbo_native_app? %>
|
||||||
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-10">
|
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-10">
|
||||||
<%= render 'shared/settings_nav' %>
|
<%= render 'shared/settings_nav' %>
|
||||||
<div class="flex-grow">
|
<div class="flex-grow">
|
||||||
|
|||||||
Reference in new issue
Block a user