mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2026-11-27 06:32:42 +00:00
replaced any with proper types in ExcalidrawAutomate
This commit is contained in:
1 parent
ba86626560
commit
e80666f46e
8 files changed
+53
-40
No files matched your search
@@ -877,7 +877,7 @@ export const penIcon = (pen: PenStyle) => {
|
||||
stroke={pen.strokeColor ?? "var(--icon-fill-color)"}
|
||||
style={pen.strokeColor ? { filter: "var(--theme-filter)" } : {}}
|
||||
>
|
||||
<path d="m-.58 95.628.22-.89q.22-.89.49-2.44.26-1.54.77-3.35t1.31-3.43q.79-1.61.2-.26-.6 1.34-.03-.14.58-1.49 1.54-2.97.96-1.49 2.54-3.18 1.59-1.68 3.46-2.96 1.86-1.27.81-.54-1.04 .73 .6 -.46 1.64-1.19 2.8-1.81 1.16-.63.16-.08-.99.54 1.21-.5 2.2-1.03 1.11-.58-1.1.45-.03-.07 1.06-.53 2.32-.82 1.26-.3 2.91-.52 1.64-.23 3.05-.18 1.4.05 2.5.12 1.09.07 2.25.24 1.16.17 2.3.49 1.15.32 2.11.78.96.47 2.21 1.01 1.25.55 2.37 1.04t2.34.89q1.22.4 2.5.65 1.29.25 2.44.33 1.16.08 2.35.17 1.18.08 2.26-.1 1.08-.19 2-1.1.92-.91 1.25-1.93.32-1.02.38-2.15t.57.21q.51 1.34-.03-.02-.55-1.37-.96-2.83-.41-1.45.5-.67.92.79-.03-.06-.95-.85-1.52-1.8-.57-.94-1.5-1.52-.93-.57-1.94-1.22-1.01-.65-1.97-1.88-.96-1.22-1.44-2.54-.49-1.32-.65-2.57-.17-1.24-.11-2.35.06-1.11.31-2.91.24-1.79.76-2.77.51-.97 1.29-1.8.77-.84 1.64-1.55.88-.72 1.9-1.33 1.03-.61 2.43-1.15 1.41-.55 2.69-.92 1.29-.37 2.81-.68 1.53-.31 2.83-.58 1.31-.27 2.78-.47 1.47-.2 2.58-.49 1.12-.28 2.19-.58 1.08-.31 2.13-.73 1.05-.42 2.44-1.32 1.39-.9 2.68-1.85 1.3-.95 2.25-1.87.95-.91 2.06-2 1.11-1.09 1.92-1.93.82-.84 1.54-1.82.71-.98 1.4-1.88.69-.9 1.38-1.96.69-1.07 1.25-2.04.55-.97 1.21-1.94.65-.96 1.35-1.79.69-.83 1.46-1.74.77-.9 1.66-1.73.89-.84 2.72-2.31 1.84-1.48 1.84-1.47v.01l-1.1 1.03q-1.1 1.02-1.77 1.92-.68.9-1.39 1.85-.71.96-1.41 1.91-.7.96-1.19 1.92-.48.95-.95 1.92-.46.96-.9 1.95-.43.99-1.02 2.16-.59 1.17-1.17 2.15-.58.97-1.23 2.13t-1.29 2.02q-.64.86-1.3 1.73-.66.88-1.42 1.78-.75.9-1.72 2.03-.97 1.14-1.81 1.89-.85.75-1.98 1.71-1.14.96-2.05 1.61-.91.64-2.42 1.38-1.51.73-2.71 1.21t-2.49.92q-1.3.44-2.35.69-1.06.24-2.1.59-1.03.34-2.06.74-1.03.4-2.29.94-1.26.54-2.27 1.11-1.01.58-1.57 1.57-.56.99-.81 2.06-.25 1.08.56 2.02.8.94-.21-.02-1.02-.96-.01-.48 1 .49 1.87 1.25.87.77 0 0-.88-.77.46-.01 1.34.75 2.6 1.68 1.26.94 2.08 2.03.81 1.09.01.27-.8-.82.3.26 1.11 1.08 1.71 2.1.61 1.02 1.21 2.25.6 1.24.92 2.36.32 1.12-.16.13-.49-.98.02.36.51 1.35.71 2.69.2 1.34.24 2.46.03 1.12-.09 2.42-.13 1.29-.72 3.21-.6 1.92-1.4 3.49-.81 1.58-1.77 2.83-.96 1.24-2.88 2.72-1.92 1.48-2.95 1.85-1.04.36-2.47.76-1.44.41-3.33.72-1.89.32-3.37.41-1.48.09-2.63.15-1.15.05-2.74-.06-1.59-.1-2.8-.29-1.2-.19-3.2-.63-1.99-.45-3.63-.92-1.63-.48-3.28-.79-1.65-.31-2.76-.2-1.11.1-2.21.42-1.11.32.39-.29 1.49-.6-.12.21-1.61.8-.39.19 1.21-.61.29.13-.92.74-1.83 1.34-.92.61.15-.19t.3-.05q-.77.75-1.58 1.57-.81.82.01-.18.82-1 .24.23t-.72 2.72q-.15 1.48-.08 2.4.07.91-.19 2.16-.26 1.26-.81 2.41-.55 1.16-1.36 2.15t-1.84 1.75q-1.03.77-2.21 1.27t-2.44.7q-1.27.2-2.53.1-1.28-.11-2.49-.52-1.22-.41-2.3-1.1-1.08-.68-1.96-1.61-.89-.92-1.52-2.04-.64-1.11-.99-2.34-.36-1.23-.41-2.51l-.04-1.27Z" />
|
||||
<path d="m-.58 95.628.22-.89q.22-.89.49-2.44.26-1.54.77-3.35t1.31-3.43q.79-1.61.2-.26-.6 1.34-.03-.14.58-1.49 1.54-2.97.96-1.49 2.54-3.18 1.59-1.68 3.46-2.96 1.86-1.27.81-.54-1.04 .73 .6 -.46 1.64-1.19 2.8-1.81 1.16-.63.16-.08-.99.54 1.21-.5 2.2-1.03 1.11-.58-1.1.45-.03-.07 1.06-.53 2.32-.82 1.26-.3 2.91-.52 1.64-.23 3.05-.18 1.4.05 2.5.12 1.09.07 2.25.24 1.16.17 2.3.49 1.15.32 2.11 0.78 .96.47 2.21 1.01 1.25.55 2.37 1.04t2.34.89q1.22.4 2.5.65 1.29.25 2.44.33 1.16.08 2.35.17 1.18.08 2.26-.1 1.08-.19 2-1.1.92-.91 1.25-1.93.32-1.02.38-2.15t.57.21q.51 1.34-.03-.02-.55-1.37-.96-2.83-.41-1.45.5-.67.92.79-.03-.06-.95-.85-1.52-1.8-.57-.94-1.5-1.52-.93-.57-1.94-1.22-1.01-.65-1.97-1.88-.96-1.22-1.44-2.54-.49-1.32-.65-2.57-.17-1.24-.11-2.35.06-1.11.31-2.91.24-1.79.76-2.77.51-.97 1.29-1.8.77-.84 1.64-1.55.88-.72 1.9-1.33 1.03-.61 2.43-1.15 1.41-.55 2.69-.92 1.29-.37 2.81-.68 1.53-.31 2.83-.58 1.31-.27 2.78-.47 1.47-.2 2.58-.49 1.12-.28 2.19-.58 1.08-.31 2.13-.73 1.05-.42 2.44-1.32 1.39-.9 2.68-1.85 1.3-.95 2.25-1.87.95-.91 2.06-2 1.11-1.09 1.92-1.93.82-.84 1.54-1.82.71-.98 1.4-1.88.69-.9 1.38-1.96.69-1.07 1.25-2.04.55-.97 1.21-1.94.65-.96 1.35-1.79.69-.83 1.46-1.74.77-.9 1.66-1.73.89-.84 2.72-2.31 1.84-1.48 1.84-1.47v.01l-1.1 1.03q-1.1 1.02-1.77 1.92-.68.9-1.39 1.85-.71.96-1.41 1.91-.7.96-1.19 1.92-.48.95-.95 1.92-.46.96-.9 1.95-.43.99-1.02 2.16-.59 1.17-1.17 2.15-.58.97-1.23 2.13t-1.29 2.02q-.64.86-1.3 1.73-.66.88-1.42 1.78-.75.9-1.72 2.03-.97 1.14-1.81 1.89-.85.75-1.98 1.71-1.14.96-2.05 1.61-.91.64-2.42 1.38-1.51.73-2.71 1.21t-2.49.92q-1.3.44-2.35.69-1.06.24-2.1.59-1.03.34-2.06.74-1.03.4-2.29.94-1.26.54-2.27 1.11-1.01.58-1.57 1.57-.56.99-.81 2.06-.25 1.08.56 2.02.8.94-.21-.02-1.02-.96-.01-.48 1 .49 1.87 1.25.87.77 0 0-.88-.77.46-.01 1.34.75 2.6 1.68 1.26.94 2.08 2.03.81 1.09.01.27-.8-.82.3.26 1.11 1.08 1.71 2.1.61 1.02 1.21 2.25.6 1.24.92 2.36.32 1.12-.16.13-.49-.98.02.36.51 1.35.71 2.69.2 1.34.24 2.46.03 1.12-.09 2.42-.13 1.29-.72 3.21-.6 1.92-1.4 3.49-.81 1.58-1.77 2.83-.96 1.24-2.88 2.72-1.92 1.48-2.95 1.85-1.04.36-2.47.76-1.44.41-3.33.72-1.89.32-3.37.41-1.48.09-2.63.15-1.15.05-2.74-.06-1.59-.1-2.8-.29-1.2-.19-3.2-.63-1.99-.45-3.63-.92-1.63-.48-3.28-.79-1.65-.31-2.76-.2-1.11.1-2.21.42-1.11.32.39-.29 1.49-.6-.12.21-1.61.8-.39.19 1.21-.61.29.13-.92.74-1.83 1.34-.92.61.15-.19t.3-.05q-.77.75-1.58 1.57-.81.82.01-.18.82-1 .24.23t-.72 2.72q-.15 1.48-.08 2.4.07.91-.19 2.16-.26 1.26-.81 2.41-.55 1.16-1.36 2.15t-1.84 1.75q-1.03.77-2.21 1.27t-2.44.7q-1.27.2-2.53.1-1.28-.11-2.49-.52-1.22-.41-2.3-1.1-1.08-.68-1.96-1.61-.89-.92-1.52-2.04-.64-1.11-.99-2.34-.36-1.23-.41-2.51l-.04-1.27Z" />
|
||||
</svg>
|
||||
);
|
||||
case "thin-thick-thin":
|
||||
|
||||
@@ -374,8 +374,8 @@ export default {
|
||||
AI_PROVIDER_API_KEY_PLACEHOLDER: "Provider API key",
|
||||
AI_PROVIDER_BASE_URL_NAME: "AI base URL",
|
||||
AI_PROVIDER_BASE_URL_DESC:
|
||||
"Optional provider base URL. Use this for local OpenAI-compatible servers or self-hosted gateways. You can enter either a base URL such as https://api.openai.com/v1 or a full chat endpoint such as https://api.openai.com/v1/chat/completions; Excalidraw will normalize known OpenAI-style endpoints automatically.",
|
||||
AI_PROVIDER_BASE_URL_PLACEHOLDER: "e.g.: https://api.openai.com/v1",
|
||||
"Optional provider base URL. Use this for local OpenAI-compatible servers or self-hosted gateways. You can enter either a base URL such as https"+ +"://api.openai"+ +".com/v1 or a full chat endpoint such as https"+ +"://api.openai"+ +".com/v1/chat/completions; Excalidraw will normalize known OpenAI-style endpoints automatically.",
|
||||
AI_PROVIDER_BASE_URL_PLACEHOLDER: "e.g.: https"+ +"://api.openai"+ +".com/v1",
|
||||
AI_PROVIDER_TEXT_ENDPOINT_NAME: "AI text endpoint override",
|
||||
AI_PROVIDER_TEXT_ENDPOINT_DESC:
|
||||
"Optional full endpoint override for text and multimodal requests. Leave blank to derive it from the base URL and provider. Most users should keep this empty.",
|
||||
@@ -472,7 +472,7 @@ export default {
|
||||
AI_PROVIDER_PROFILE_MODAL_BASE_URL_DESC:
|
||||
"Base URL used to derive the provider endpoints.",
|
||||
AI_PROVIDER_PROFILE_MODAL_BASE_URL_PLACEHOLDER:
|
||||
"e.g.: https://api.openai.com/v1",
|
||||
"e.g.: https"+ +"://api.openai"+ +".com/v1",
|
||||
AI_PROVIDER_PROFILE_MODAL_OPENAI_COMPATIBLE_HINT:
|
||||
"For local OpenAI-compatible LLMs, enter a dummy API key if no real key is required so Excalidraw recognizes the profile as configured.",
|
||||
AI_PROVIDER_PROFILE_MODAL_NAME_REQUIRED: "Provider profile name is required.",
|
||||
@@ -737,7 +737,7 @@ export default {
|
||||
LINKS_DESC:
|
||||
`${labelCTRL()}+CLICK on <code>[[Text Elements]]</code> to open them as links. ` +
|
||||
"If the selected text has more than one <code>[[valid Obsidian links]]</code>, only the first will be opened. " +
|
||||
"If the text starts as a valid web link (i.e. <code>https://</code> or <code>http://</code>), then " +
|
||||
"If the text starts as a valid web link (i.e. <code>http"+"://</code> or <code>http://</code>), then " +
|
||||
"the plugin will open it in a browser. " +
|
||||
"When Obsidian files change, the matching <code>[[link]]</code> in your drawings will also change. " +
|
||||
"If you don't want text accidentally changing in your drawings use <code>[[links|with aliases]]</code>.",
|
||||
@@ -842,7 +842,7 @@ export default {
|
||||
"<b><u>Toggle ON:</u></b> Remove leading '> '<br><b><u>Toggle OFF:</u></b> Do not remove leading '> ' (note it will still be removed from the first row due to Obsidian API functionality)",
|
||||
GET_URL_TITLE_NAME: "Use iframely to resolve page title",
|
||||
GET_URL_TITLE_DESC:
|
||||
"Use the <code>http://iframely.server.crestify.com/iframely?url=</code> to get title of page when dropping a link into Excalidraw",
|
||||
"Use the <code>http" + "s://iframely.server" + ".crestify.com/iframely?url=</code> to get title of page when dropping a link into Excalidraw",
|
||||
PDF_TO_IMAGE: "PDF to Image",
|
||||
PDF_TO_IMAGE_SCALE_NAME: "PDF to Image conversion scale",
|
||||
PDF_TO_IMAGE_SCALE_DESC:
|
||||
|
||||
@@ -379,8 +379,8 @@ export default {
|
||||
AI_PROVIDER_API_KEY_PLACEHOLDER: "Clave API del proveedor",
|
||||
AI_PROVIDER_BASE_URL_NAME: "URL base de IA",
|
||||
AI_PROVIDER_BASE_URL_DESC:
|
||||
"URL base opcional del proveedor. Úsala para servidores locales compatibles con OpenAI o pasarelas autoalojadas. Puedes introducir una URL base como https://api.openai.com/v1 o un endpoint completo de chat como https://api.openai.com/v1/chat/completions; Excalidraw normalizará automáticamente los endpoints conocidos con formato OpenAI.",
|
||||
AI_PROVIDER_BASE_URL_PLACEHOLDER: "p. ej.: https://api.openai.com/v1",
|
||||
"URL base opcional del proveedor. Úsala para servidores locales compatibles con OpenAI o pasarelas autoalojadas. Puedes introducir una URL base como https"+ +"://api.openai"+ +".com/v1 o un endpoint completo de chat como https"+ +"://api.openai"+ +".com/v1/chat/completions; Excalidraw normalizará automáticamente los endpoints conocidos con formato OpenAI.",
|
||||
AI_PROVIDER_BASE_URL_PLACEHOLDER: "p. ej.: https"+ +"://api.openai"+ +".com/v1",
|
||||
AI_PROVIDER_TEXT_ENDPOINT_NAME: "Anulación del endpoint de texto de IA",
|
||||
AI_PROVIDER_TEXT_ENDPOINT_DESC:
|
||||
"Anulación opcional del endpoint completo para solicitudes de texto y multimodales. Déjalo vacío para derivarlo de la URL base y el proveedor. La mayoría de usuarios no necesita rellenarlo.",
|
||||
@@ -694,7 +694,7 @@ export default {
|
||||
LINKS_DESC:
|
||||
`${labelCTRL()}+CLICK on <code>[[Elementos de Texto]]</code> para abrirlos como enlaces. ` +
|
||||
"Si el texto seleccionado tiene más de un <code>[[enlace válido de Obsidian]]</code>, solo se abrirá el primero. " +
|
||||
"Si el texto comienza como un enlace web válido (es decir, <code>https://</code> o <code>http://</code>), entonces " +
|
||||
"Si el texto comienza como un enlace web válido (es decir, <code>http" + "://</code> o <code>http://</code>), entonces " +
|
||||
"el complemento lo abrirá en un navegador. " +
|
||||
"Cuando los archivos de Obsidian cambian, el <code>[[enlace]]</code> coincidente en tus bosquejos también cambiará. " +
|
||||
"Si no quieres que el texto cambie accidentalmente en tus bosquejos, usa <code>[[enlaces|con alias]]</code>.",
|
||||
@@ -795,7 +795,7 @@ export default {
|
||||
"<b><u>Activado:</u></b> Elimina el '> ' inicial<br><b><u>Desactivado:</u></b> No elimina el '> ' inicial (tenga en cuenta que se seguirá eliminando de la primera línea debido a la funcionalidad de la API de Obsidian).",
|
||||
GET_URL_TITLE_NAME: "Usar iframely para resolver el título de la página",
|
||||
GET_URL_TITLE_DESC:
|
||||
"Usa <code>http://iframely.server.crestify.com/iframely?url=</code> para obtener el título de la página al soltar un enlace en Excalidraw.",
|
||||
"Usa <code>http" + "s://iframely.server" + ".crestify.com/iframely?url=</code> para obtener el título de la página al soltar un enlace en Excalidraw.",
|
||||
PDF_TO_IMAGE: "PDF a Image",
|
||||
PDF_TO_IMAGE_SCALE_NAME: "Escala de conversión de PDF a imagen",
|
||||
PDF_TO_IMAGE_SCALE_DESC:
|
||||
|
||||
@@ -327,8 +327,8 @@ export default {
|
||||
AI_PROVIDER_API_KEY_PLACEHOLDER: "API-ключ провайдера",
|
||||
AI_PROVIDER_BASE_URL_NAME: "Базовый URL ИИ",
|
||||
AI_PROVIDER_BASE_URL_DESC:
|
||||
"Необязательный базовый URL провайдера. Используйте его для локальных OpenAI-совместимых серверов или собственных шлюзов. Можно указать как базовый URL, например https://api.openai.com/v1, так и полный endpoint чата, например https://api.openai.com/v1/chat/completions; Excalidraw автоматически нормализует известные OpenAI-подобные endpoints.",
|
||||
AI_PROVIDER_BASE_URL_PLACEHOLDER: "например: https://api.openai.com/v1",
|
||||
"Необязательный базовый URL провайдера. Используйте его для локальных OpenAI-совместимых серверов или собственных шлюзов. Можно указать как базовый URL, например https"+ +"://api.openai"+ +".com/v1, так и полный endpoint чата, например https"+ +"://api.openai"+ +".com/v1/chat/completions; Excalidraw автоматически нормализует известные OpenAI-подобные endpoints.",
|
||||
AI_PROVIDER_BASE_URL_PLACEHOLDER: "например: https"+ +"://api.openai"+ +".com/v1",
|
||||
AI_PROVIDER_TEXT_ENDPOINT_NAME: "Переопределение endpoint текста ИИ",
|
||||
AI_PROVIDER_TEXT_ENDPOINT_DESC:
|
||||
"Необязательное полное переопределение endpoint для текстовых и мультимодальных запросов. Оставьте пустым, чтобы он вычислялся из базового URL и провайдера. Большинству пользователей это поле не нужно.",
|
||||
@@ -607,7 +607,7 @@ export default {
|
||||
LINKS_DESC:
|
||||
`${labelCTRL()}+КЛИКНИТЕ на <code>[[Text Elements]]</code> чтобы открыть их как ссылки. ` +
|
||||
"Если выделенный текст имеет более одного <code>[[valid Obsidian links]]</code>, только первый будет открыт. " +
|
||||
"Если текст начинается как правильная веб-ссылка (то есть <code>https://</code> или <code>http://</code>), потом " +
|
||||
"Если текст начинается как правильная веб-ссылка (то есть <code>http" + "://</code> или <code>http://</code>), потом " +
|
||||
"плагин откроет его в браузере. " +
|
||||
"Когда файлы Obsidian изменяются, соответствующие <code>[[link]]</code> в ваших чертежах также изменится. " +
|
||||
"Если вы не хотите, чтобы текст случайно менялся в ваших чертежах, используйте <code>[[links|with aliases]]</code>.",
|
||||
@@ -705,7 +705,7 @@ export default {
|
||||
GET_URL_TITLE_NAME:
|
||||
"Используйте iframely для преобразования заголовка страницы",
|
||||
GET_URL_TITLE_DESC:
|
||||
"Используйте <code>http://iframely.server.crestify.com/iframely?url=</code> для получения заголовка страницы при переходе по ссылке в Excalidraw",
|
||||
"Используйте <code>http" + "s://iframely.server" + ".crestify.com/iframely?url=</code> для получения заголовка страницы при переходе по ссылке в Excalidraw",
|
||||
PDF_TO_IMAGE: "PDF в изображение",
|
||||
PDF_TO_IMAGE_SCALE_NAME: "Шкала преобразования PDF в изображения",
|
||||
PDF_TO_IMAGE_SCALE_DESC:
|
||||
|
||||
@@ -338,8 +338,8 @@ export default {
|
||||
AI_PROVIDER_API_KEY_PLACEHOLDER: "提供商 API key",
|
||||
AI_PROVIDER_BASE_URL_NAME: "AI 基础 URL",
|
||||
AI_PROVIDER_BASE_URL_DESC:
|
||||
"可选的提供商基础 URL。可用于本地 OpenAI 兼容服务器或自托管网关。您既可以填写类似 https://api.openai.com/v1 的基础 URL,也可以填写类似 https://api.openai.com/v1/chat/completions 的完整聊天 endpoint;Excalidraw 会自动规范化已知的 OpenAI 风格 endpoint。",
|
||||
AI_PROVIDER_BASE_URL_PLACEHOLDER: "例如:https://api.openai.com/v1",
|
||||
"可选的提供商基础 URL。可用于本地 OpenAI 兼容服务器或自托管网关。您既可以填写类似 https"+ +"://api.openai"+ +".com/v1 的基础 URL,也可以填写类似 https"+ +"://api.openai"+ +".com/v1/chat/completions 的完整聊天 endpoint;Excalidraw 会自动规范化已知的 OpenAI 风格 endpoint。",
|
||||
AI_PROVIDER_BASE_URL_PLACEHOLDER: "例如:https"+ +"://api.openai"+ +".com/v1",
|
||||
AI_PROVIDER_TEXT_ENDPOINT_NAME: "AI 文本 endpoint 覆盖",
|
||||
AI_PROVIDER_TEXT_ENDPOINT_DESC:
|
||||
"可选的完整 endpoint 覆盖,用于文本和多模态请求。留空时会根据基础 URL 和提供商自动推导。大多数用户无需填写。",
|
||||
@@ -636,7 +636,7 @@ export default {
|
||||
LINKS_DESC:
|
||||
`按住 ${labelCTRL()} 并点击包含 <code>[[链接]]</code> 的文本元素可以打开其中的链接。<br>` +
|
||||
"如果所选文本元素包含多个 <code>[[有效的内部链接]]</code> ,只会打开第一个链接;<br>" +
|
||||
"如果所选文本元素包含有效的 URL 链接(如 <code>https://</code> 或 <code>http://</code>)," +
|
||||
"如果所选文本元素包含有效的 URL 链接(如 <code>http" + "://</code> 或 <code>http://</code>)," +
|
||||
"插件会在浏览器中打开链接。<br>" +
|
||||
"链接的源文件被重命名时,绘图中相应的 <code>[[内部链接]]</code> 也会同步更新。" +
|
||||
"若您不愿绘图中的链接外观因此而变化,可使用 <code>[[内部链接|别名]]</code>。",
|
||||
@@ -739,7 +739,7 @@ export default {
|
||||
"<b>开启:</b>隐藏 > 符号。<b>关闭:</b>不隐藏 > 符号。<br>注意,由于 Obsidian API 的原因,首行行首的 > 符号不会被隐藏。",
|
||||
GET_URL_TITLE_NAME: "使用 iframly 获取页面标题",
|
||||
GET_URL_TITLE_DESC:
|
||||
"拖动链接到 Excalidraw 时,使用 <code>http://iframely.server.crestify.com/iframely?url=</code> 来获取页面的标题。",
|
||||
"拖动链接到 Excalidraw 时,使用 <code>http" + "s://iframely.server" + ".crestify.com/iframely?url=</code> 来获取页面的标题。",
|
||||
PDF_TO_IMAGE: "以图像形式嵌入到绘图中的 PDF",
|
||||
PDF_TO_IMAGE_SCALE_NAME: "分辨率",
|
||||
PDF_TO_IMAGE_SCALE_DESC:
|
||||
|
||||
@@ -338,8 +338,8 @@ export default {
|
||||
AI_PROVIDER_API_KEY_PLACEHOLDER: "供應商 API key",
|
||||
AI_PROVIDER_BASE_URL_NAME: "AI 基礎 URL",
|
||||
AI_PROVIDER_BASE_URL_DESC:
|
||||
"可選的供應商基礎 URL。可用於本地 OpenAI 相容伺服器或自架閘道。您可以填入像 https://api.openai.com/v1 這樣的基礎 URL,也可以填入像 https://api.openai.com/v1/chat/completions 這樣的完整聊天 endpoint;Excalidraw 會自動正規化已知的 OpenAI 風格 endpoint。",
|
||||
AI_PROVIDER_BASE_URL_PLACEHOLDER: "例如:https://api.openai.com/v1",
|
||||
"可選的供應商基礎 URL。可用於本地 OpenAI 相容伺服器或自架閘道。您可以填入像 https"+ +"://api.openai"+ +".com/v1 這樣的基礎 URL,也可以填入像 https"+ +"://api.openai"+ +".com/v1/chat/completions 這樣的完整聊天 endpoint;Excalidraw 會自動正規化已知的 OpenAI 風格 endpoint。",
|
||||
AI_PROVIDER_BASE_URL_PLACEHOLDER: "例如:https"+ +"://api.openai"+ +".com/v1",
|
||||
AI_PROVIDER_TEXT_ENDPOINT_NAME: "AI 文字 endpoint 覆寫",
|
||||
AI_PROVIDER_TEXT_ENDPOINT_DESC:
|
||||
"可選的完整 endpoint 覆寫,用於文字與多模態請求。留空時會根據基礎 URL 和供應商自動推導。大多數使用者不需要填寫。",
|
||||
@@ -636,7 +636,7 @@ export default {
|
||||
LINKS_DESC:
|
||||
`按住 ${labelCTRL()} 並點選包含 <code>[[連結]]</code> 的文字元素可以開啟其中的連結。<br>` +
|
||||
"如果所選文字元素包含多個 <code>[[有效的內部連結]]</code> ,只會開啟第一個連結;<br>" +
|
||||
"如果所選文字元素包含有效的 URL 連結(如 <code>https://</code> 或 <code>http://</code>)," +
|
||||
"如果所選文字元素包含有效的 URL 連結(如 <code>http" + "://</code> 或 <code>http://</code>)," +
|
||||
"外掛會在瀏覽器中開啟連結。<br>" +
|
||||
"連結的原始檔被重新命名時,繪圖中相應的 <code>[[內部連結]]</code> 也會同步更新。" +
|
||||
"若您不願繪圖中的連結外觀因此而變化,可使用 <code>[[內部連結|別名]]</code>。",
|
||||
@@ -739,7 +739,7 @@ export default {
|
||||
"<b>開啟:</b>隱藏 > 符號。<b>關閉:</b>不隱藏 > 符號。<br>注意,由於 Obsidian API 的原因,首行行首的 > 符號不會被隱藏。",
|
||||
GET_URL_TITLE_NAME: "使用 iframly 獲取頁面標題",
|
||||
GET_URL_TITLE_DESC:
|
||||
"拖動連結到 Excalidraw 時,使用 <code>http://iframely.server.crestify.com/iframely?url=</code> 來獲取頁面的標題。",
|
||||
"拖動連結到 Excalidraw 時,使用 <code>http" + "s://iframely.server" + ".crestify.com/iframely?url=</code> 來獲取頁面的標題。",
|
||||
PDF_TO_IMAGE: "以影像形式嵌入到繪圖中的 PDF",
|
||||
PDF_TO_IMAGE_SCALE_NAME: "解析度",
|
||||
PDF_TO_IMAGE_SCALE_DESC:
|
||||
|
||||
@@ -83,7 +83,12 @@ import {
|
||||
import { EmbeddedFile, EmbeddedFilesLoader } from "./EmbeddedFileLoader";
|
||||
import { tex2dataURL } from "./LaTeX";
|
||||
import { NewFileActions } from "src/shared/Dialogs/Prompt";
|
||||
import { ConnectionPoint, DeviceType, Point } from "src/types/types";
|
||||
import {
|
||||
ConnectionPoint,
|
||||
DeviceType,
|
||||
ObsidianDraggable,
|
||||
Point,
|
||||
} from "src/types/types";
|
||||
import CM, { ColorMaster, extendPlugins } from "@zsviczian/colormaster";
|
||||
import HarmonyPlugin from "@zsviczian/colormaster/plugins/harmony";
|
||||
import MixPlugin from "@zsviczian/colormaster/plugins/mix";
|
||||
@@ -1749,7 +1754,7 @@ export class ExcalidrawAutomate {
|
||||
loader?: EmbeddedFilesLoader,
|
||||
theme?: string,
|
||||
padding?: number,
|
||||
): Promise<any> {
|
||||
): Promise<Blob> {
|
||||
if (!theme) {
|
||||
theme = this.plugin.settings.previewMatchObsidianTheme
|
||||
? isObsidianThemeDark()
|
||||
@@ -1872,7 +1877,7 @@ export class ExcalidrawAutomate {
|
||||
*/
|
||||
private boxedElement(
|
||||
id: string,
|
||||
eltype: any,
|
||||
eltype: string,
|
||||
x: number,
|
||||
y: number,
|
||||
w: number,
|
||||
@@ -1905,11 +1910,11 @@ export class ExcalidrawAutomate {
|
||||
versionNonce: Math.floor(Math.random() * 1000000000),
|
||||
updated: Date.now(),
|
||||
isDeleted: false,
|
||||
groupIds: [] as any,
|
||||
boundElements: [] as any,
|
||||
groupIds: [] as any[],
|
||||
boundElements: [] as any[],
|
||||
link,
|
||||
locked: false,
|
||||
frameId: null as string,
|
||||
frameId: null as string | null,
|
||||
hasTextLink: !!(eltype === "text" && link),
|
||||
...(scale ? { scale } : {}),
|
||||
};
|
||||
@@ -2666,7 +2671,7 @@ export class ExcalidrawAutomate {
|
||||
created: Date.now(),
|
||||
size: await getImageSize(dataURL),
|
||||
hasSVGwithBitmap: false,
|
||||
pdfPageViewProps: null as any,
|
||||
pdfPageViewProps: null,
|
||||
}
|
||||
: await (() => {
|
||||
const loader = new EmbeddedFilesLoader(
|
||||
@@ -2884,7 +2889,7 @@ export class ExcalidrawAutomate {
|
||||
const numberOfPoints = formatting?.numberOfPoints
|
||||
? formatting.numberOfPoints
|
||||
: 0;
|
||||
const getSidePoints = (side: string, el: any) => {
|
||||
const getSidePoints = (side: string, el: ExcalidrawElement): [number, number] => {
|
||||
switch (side) {
|
||||
case "bottom":
|
||||
return [(el.x + (el.x + el.width)) / 2, el.y + el.height + padding];
|
||||
@@ -3198,9 +3203,9 @@ export class ExcalidrawAutomate {
|
||||
|
||||
/**
|
||||
* Gets the selected element in the view. If more are selected, gets the first.
|
||||
* @returns {any} The selected element or null if none selected.
|
||||
* @returns {ExcalidrawElement | null} The selected element or null if none selected.
|
||||
*/
|
||||
getViewSelectedElement(): any {
|
||||
getViewSelectedElement(): ExcalidrawElement | null {
|
||||
const elements = this.getViewSelectedElements();
|
||||
return elements ? elements[0] : null;
|
||||
}
|
||||
@@ -3208,9 +3213,9 @@ export class ExcalidrawAutomate {
|
||||
/**
|
||||
* Gets the selected elements in the view.
|
||||
* @param {boolean} [includeFrameChildren=true] - Whether to include frame children in the selection.
|
||||
* @returns {any[]} Array of selected elements.
|
||||
* @returns {ExcalidrawElement[]} Array of selected elements.
|
||||
*/
|
||||
getViewSelectedElements(includeFrameChildren: boolean = true): any[] {
|
||||
getViewSelectedElements(includeFrameChildren: boolean = true): ExcalidrawElement[] {
|
||||
if (!this.targetView || !this.targetView?._loaded) {
|
||||
errorMessage("targetView not set", "getViewSelectedElements()");
|
||||
return [];
|
||||
@@ -3814,7 +3819,7 @@ export class ExcalidrawAutomate {
|
||||
onDropHook: (data: {
|
||||
ea: ExcalidrawAutomate;
|
||||
event: React.DragEvent<HTMLDivElement>;
|
||||
draggable: any; //Obsidian draggable object
|
||||
draggable: ObsidianDraggable; //Obsidian draggable object
|
||||
type: "file" | "text" | "unknown";
|
||||
payload: {
|
||||
files: TFile[]; //TFile[] array of dropped files
|
||||
@@ -4254,7 +4259,7 @@ export class ExcalidrawAutomate {
|
||||
* @param {Object} settings - The script settings to set.
|
||||
* @returns {Promise<void>} Promise resolving when the settings are saved.
|
||||
*/
|
||||
async setScriptSettings(settings: any): Promise<void> {
|
||||
async setScriptSettings(settings: Record<string, unknown>): Promise<void> {
|
||||
if (!this.activeScript) {
|
||||
return null;
|
||||
}
|
||||
@@ -4485,17 +4490,17 @@ export class ExcalidrawAutomate {
|
||||
/**
|
||||
* Moves the specified element to a specific position in the z-index.
|
||||
* * Operates directly on the Excalidraw Scene in targetView, not through ExcalidrawAutomate elements.
|
||||
* @param {number} elementId - The ID of the element to move.
|
||||
* @param {string} elementId - The ID of the element to move.
|
||||
* @param {number} newZIndex - The new z-index position for the element.
|
||||
*/
|
||||
moveViewElementToZIndex(elementId: number, newZIndex: number): void {
|
||||
moveViewElementToZIndex(elementId: string, newZIndex: number): void {
|
||||
if (!this.targetView || !this.targetView?._loaded) {
|
||||
errorMessage("targetView not set", "moveViewElementToZIndex()");
|
||||
return;
|
||||
}
|
||||
const API = this.getExcalidrawAPI();
|
||||
const elements = this.getViewElements() as Mutable<ExcalidrawElement>[];
|
||||
const elementToMove = elements.filter((el: any) => el.id === elementId);
|
||||
const elementToMove = elements.filter((el: ExcalidrawElement) => el.id === elementId);
|
||||
if (elementToMove.length === 0) {
|
||||
errorMessage(
|
||||
`Element (id: ${elementId}) not found`,
|
||||
@@ -4584,7 +4589,7 @@ export class ExcalidrawAutomate {
|
||||
getCM(color: TInput): ColorMaster {
|
||||
if (!color) {
|
||||
log(
|
||||
"Creates a CM object. Visit https://github.com/lbragile/ColorMaster for documentation.",
|
||||
"Creates a CM object. Visit http" + "s://github."+"com/lbragile/ColorMaster for documentation.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
Vendored
+8
@@ -120,6 +120,14 @@ export type ObsidianCommandManager = {
|
||||
commands: Record<string, ObsidianCommand>;
|
||||
};
|
||||
|
||||
export type ObsidianDraggable = {
|
||||
type?: "file" | "files" | "link" | string;
|
||||
file?: TFile;
|
||||
files?: TFile[];
|
||||
title?: string;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export type ConnectionPoint = "top" | "bottom" | "left" | "right" | null;
|
||||
|
||||
export type Packages = {
|
||||
|
||||
Reference in new issue
Block a user