diff --git a/e2e-tests/whiteboards.spec.ts b/e2e-tests/whiteboards.spec.ts index fb10d871de..50edd8aaeb 100644 --- a/e2e-tests/whiteboards.spec.ts +++ b/e2e-tests/whiteboards.spec.ts @@ -85,10 +85,10 @@ test('draw a rectangle', async ({ page }) => { await page.keyboard.type('wr') - await page.mouse.move(bounds.x + 5, bounds.y + 5) + await page.mouse.move(bounds.x + 105, bounds.y + 105) await page.mouse.down() - await page.mouse.move(bounds.x + 50, bounds.y + 50 ) + await page.mouse.move(bounds.x + 150, bounds.y + 150 ) await page.mouse.up() await page.keyboard.press('Escape') @@ -114,12 +114,14 @@ test('clone the rectangle', async ({ page }) => { const canvas = await page.waitForSelector('.logseq-tldraw') const bounds = (await canvas.boundingBox())! - await page.mouse.move(bounds.x + 20, bounds.y + 20, {steps: 5}) + await page.mouse.move(bounds.x + 400, bounds.y + 400) + + await page.mouse.move(bounds.x + 120, bounds.y + 120, {steps: 5}) await page.keyboard.down('Alt') await page.mouse.down() - await page.mouse.move(bounds.x + 100, bounds.y + 100, {steps: 5}) + await page.mouse.move(bounds.x + 200, bounds.y + 200, {steps: 5}) await page.mouse.up() await page.keyboard.up('Alt') @@ -163,10 +165,10 @@ test('connect rectangles with an arrow', async ({ page }) => { await page.keyboard.type('wc') - await page.mouse.move(bounds.x + 20, bounds.y + 20) + await page.mouse.move(bounds.x + 120, bounds.y + 120) await page.mouse.down() - await page.mouse.move(bounds.x + 100, bounds.y + 100, {steps: 5}) // will fail without steps + await page.mouse.move(bounds.x + 200, bounds.y + 200, {steps: 5}) // will fail without steps await page.mouse.up() await page.keyboard.press('Escape') @@ -191,10 +193,15 @@ test('undo the delete action', async ({ page }) => { }) test('convert the first rectangle to ellipse', async ({ page }) => { + const canvas = await page.waitForSelector('.logseq-tldraw') + const bounds = (await canvas.boundingBox())! + await page.keyboard.press('Escape') - await page.waitForTimeout(1000) - await page.click('.logseq-tldraw .tl-box-container:first-of-type') - await page.mouse.move(0, 0) // move mouse to trigger a rerender of the context bar + await page.mouse.move(bounds.x + 220, bounds.y + 220) + await page.mouse.down() + await page.mouse.up() + await page.mouse.move(bounds.x + 520, bounds.y + 520) + await page.click('.tl-context-bar .tl-geometry-tools-pane-anchor') await page.click('.tl-context-bar .tl-geometry-toolbar [data-tool=ellipse]') @@ -223,9 +230,14 @@ test('undo the shape conversion', async ({ page }) => { }) test('locked elements should not be removed', async ({ page }) => { + const canvas = await page.waitForSelector('.logseq-tldraw') + const bounds = (await canvas.boundingBox())! + await page.keyboard.press('Escape') - await page.waitForTimeout(1000) - await page.click('.logseq-tldraw .tl-box-container:first-of-type') + await page.mouse.move(bounds.x + 220, bounds.y + 220) + await page.mouse.down() + await page.mouse.up() + await page.mouse.move(bounds.x + 520, bounds.y + 520) await page.keyboard.press(`${modKey}+l`) await page.keyboard.press('Delete') await page.keyboard.press(`${modKey}+Shift+l`) @@ -269,7 +281,7 @@ test('create a block', async ({ page }) => { const bounds = (await canvas.boundingBox())! await page.keyboard.type('ws') - await page.mouse.dblclick(bounds.x + 5, bounds.y + 5) + await page.mouse.dblclick(bounds.x + 105, bounds.y + 105) await page.waitForTimeout(100) await page.keyboard.type('a') @@ -304,7 +316,7 @@ test('copy/paste url to create an iFrame shape', async ({ page }) => { const bounds = (await canvas.boundingBox())! await page.keyboard.type('wt') - await page.mouse.move(bounds.x + 5, bounds.y + 5) + await page.mouse.move(bounds.x + 105, bounds.y + 105) await page.mouse.down() await page.waitForTimeout(100) @@ -323,7 +335,7 @@ test('copy/paste twitter status url to create a Tweet shape', async ({ page }) = const bounds = (await canvas.boundingBox())! await page.keyboard.type('wt') - await page.mouse.move(bounds.x + 5, bounds.y + 5) + await page.mouse.move(bounds.x + 105, bounds.y + 105) await page.mouse.down() await page.waitForTimeout(100) @@ -342,7 +354,7 @@ test('copy/paste youtube video url to create a Youtube shape', async ({ page }) const bounds = (await canvas.boundingBox())! await page.keyboard.type('wt') - await page.mouse.move(bounds.x + 5, bounds.y + 5) + await page.mouse.move(bounds.x + 105, bounds.y + 105) await page.mouse.down() await page.waitForTimeout(100) @@ -394,8 +406,8 @@ test('quick add another whiteboard', async ({ page }) => { const canvas = await page.waitForSelector('.logseq-tldraw') await canvas.dblclick({ position: { - x: 100, - y: 100, + x: 200, + y: 200, }, }) diff --git a/scripts/src/logseq/tasks/lang.clj b/scripts/src/logseq/tasks/lang.clj index 077b4981a5..33e3f8a3fc 100644 --- a/scripts/src/logseq/tasks/lang.clj +++ b/scripts/src/logseq/tasks/lang.clj @@ -115,6 +115,14 @@ "(t title" [] "(t subtitle" [:asset/physical-delete]}) +(defn- whiteboard-dicts + [] + (->> (shell {:out :string} + "grep -E -oh" "\\bt\\('[^ ']+" "-r" "tldraw/apps/tldraw-logseq/src/components") + :out + string/split-lines + (map #(keyword (subs % 3))))) + (defn- validate-ui-translations-are-used "This validation checks to see that translations done by (t ...) are equal to the ones defined for the default :en lang. This catches translations that have @@ -129,6 +137,7 @@ string/split-lines (map #(keyword (subs % 4))) (concat (mapcat val manual-ui-dicts)) + (concat (whiteboard-dicts)) set) expected-dicts (set (remove #(re-find #"^(command|shortcut)\." (str (namespace %))) (keys (:en (get-dicts))))) diff --git a/src/main/frontend/commands.cljs b/src/main/frontend/commands.cljs index 310a263e69..fea6d3915c 100644 --- a/src/main/frontend/commands.cljs +++ b/src/main/frontend/commands.cljs @@ -30,6 +30,7 @@ (defonce angle-bracket "<") (defonce hashtag "#") (defonce colon ":") +(defonce command-trigger "/") (defonce *current-command (atom nil)) (def query-doc @@ -52,7 +53,7 @@ "."]]) (defn link-steps [] - [[:editor/input (str (state/get-editor-command-trigger) "link")] + [[:editor/input (str command-trigger "link")] [:editor/show-input [{:command :link :id :link :placeholder "Link" @@ -62,7 +63,7 @@ :placeholder "Label"}]]]) (defn image-link-steps [] - [[:editor/input (str (state/get-editor-command-trigger) "link")] + [[:editor/input (str command-trigger "link")] [:editor/show-input [{:command :image-link :id :link :placeholder "Link" @@ -72,7 +73,7 @@ :placeholder "Label"}]]]) (defn zotero-steps [] - [[:editor/input (str (state/get-editor-command-trigger) "zotero")] + [[:editor/input (str command-trigger "zotero")] [:editor/show-zotero]]) (def *extend-slash-commands (atom [])) @@ -96,19 +97,19 @@ [type] (let [template (util/format "@@%s: @@" type)] - [[:editor/input template {:last-pattern (state/get-editor-command-trigger) + [[:editor/input template {:last-pattern command-trigger :backward-pos 2}]])) (defn embed-page [] (conj - [[:editor/input "{{embed [[]]}}" {:last-pattern (state/get-editor-command-trigger) + [[:editor/input "{{embed [[]]}}" {:last-pattern command-trigger :backward-pos 4}]] [:editor/search-page :embed])) (defn embed-block [] - [[:editor/input "{{embed (())}}" {:last-pattern (state/get-editor-command-trigger) + [[:editor/input "{{embed (())}}" {:last-pattern command-trigger :backward-pos 4}] [:editor/search-block :embed]]) @@ -229,9 +230,9 @@ ["Image link" (image-link-steps) "Create a HTTP link to a image"] (when (state/markdown?) ["Underline" [[:editor/input "" - {:last-pattern (state/get-editor-command-trigger) + {:last-pattern command-trigger :backward-pos 6}]] "Create a underline text decoration"]) - ["Template" [[:editor/input (state/get-editor-command-trigger) nil] + ["Template" [[:editor/input command-trigger nil] [:editor/search-template]] "Insert a created template here"] (cond (and (util/electron?) (config/local-db? (state/get-current-repo))) @@ -239,7 +240,7 @@ ["Upload an asset" [[:editor/click-hidden-file-input :id]] "Upload file types like image, pdf, docx, etc.)"])] ;; ["Upload an image" [[:editor/click-hidden-file-input :id]]] - + (headings) @@ -290,12 +291,12 @@ text)) "Draw a graph with Excalidraw"] ["Embed HTML " (->inline "html")] - ["Embed Video URL" [[:editor/input "{{video }}" {:last-pattern (state/get-editor-command-trigger) + ["Embed Video URL" [[:editor/input "{{video }}" {:last-pattern command-trigger :backward-pos 2}]]] ["Embed Youtube timestamp" [[:youtube/insert-timestamp]]] - ["Embed Twitter tweet" [[:editor/input "{{tweet }}" {:last-pattern (state/get-editor-command-trigger) + ["Embed Twitter tweet" [[:editor/input "{{tweet }}" {:last-pattern command-trigger :backward-pos 2}]]] ["Code block" [[:editor/input "```\n```\n" {:type "block" @@ -339,7 +340,7 @@ (when-let [input (gdom/getElement id)] (let [last-pattern (when-not (= last-pattern :skip-check) (when-not backward-truncate-number - (or last-pattern (state/get-editor-command-trigger)))) + (or last-pattern command-trigger))) edit-content (gobj/get input "value") current-pos (cursor/pos input) current-pos (or @@ -531,7 +532,7 @@ (let [edit-content (gobj/get current-input "value") current-pos (cursor/pos current-input) prefix (subs edit-content 0 current-pos) - prefix (util/replace-last (state/get-editor-command-trigger) prefix "" (boolean space?)) + prefix (util/replace-last command-trigger prefix "" (boolean space?)) new-value (str prefix (subs edit-content current-pos))] (state/set-block-content-and-last-pos! input-id diff --git a/src/main/frontend/components/settings.cljs b/src/main/frontend/components/settings.cljs index ee3cd75a1d..5ad2bd102d 100644 --- a/src/main/frontend/components/settings.cljs +++ b/src/main/frontend/components/settings.cljs @@ -385,8 +385,13 @@ (defn preferred-pasting-file [t preferred-pasting-file?] (toggle "preferred_pasting_file" - (t :settings-page/preferred-pasting-file) - preferred-pasting-file? + [(t :settings-page/preferred-pasting-file) + (ui/tippy {:html (t :settings-page/preferred-pasting-file-hint) + :class "tippy-hover ml-2" + :interactive true + :disabled false} + (svg/info))] + preferred-pasting-file? config-handler/toggle-preferred-pasting-file!)) (defn auto-expand-row [t auto-expand-block-refs?] diff --git a/src/main/frontend/extensions/tldraw.cljs b/src/main/frontend/extensions/tldraw.cljs index 927de4c9c5..409fafcf6d 100644 --- a/src/main/frontend/extensions/tldraw.cljs +++ b/src/main/frontend/extensions/tldraw.cljs @@ -5,6 +5,7 @@ [frontend.components.export :as export] [frontend.components.page :as page] [frontend.config :as config] + [frontend.context.i18n :refer [t]] [frontend.db.model :as model] [frontend.handler.editor :as editor-handler] [frontend.handler.route :as route-handler] @@ -93,7 +94,8 @@ (def undo (fn [] (history/undo! nil))) (def redo (fn [] (history/redo! nil))) (defn get-tldraw-handlers [current-whiteboard-name] - {:search search-handler + {:t (fn [key] (t (keyword key))) + :search search-handler :queryBlockByUUID (fn [block-uuid] (clj->js (model/query-block-by-uuid (parse-uuid block-uuid)))) diff --git a/src/main/frontend/handler/common/config_edn.cljs b/src/main/frontend/handler/common/config_edn.cljs index 90b7233fb9..c26b0b20e7 100644 --- a/src/main/frontend/handler/common/config_edn.cljs +++ b/src/main/frontend/handler/common/config_edn.cljs @@ -92,7 +92,7 @@ nested keys or positional errors e.g. tuples" (let [body (try (edn/read-string content) (catch :default _ ::failed-to-detect)) warnings {:editor/command-trigger - "Will no longer be supported soon. Please use '/' and report bugs on it."}] + "is no longer supported. Please use '/' and report bugs on it."}] (cond (= body ::failed-to-detect) (log/info :msg "Skip deprecation check since config is not valid edn") diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index 97802116a0..677cfa7104 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -1536,7 +1536,7 @@ (if file-obj (.-name file-obj) (if image? "image" "asset")) image?) format - {:last-pattern (if drop-or-paste? "" (state/get-editor-command-trigger)) + {:last-pattern (if drop-or-paste? "" commands/command-trigger) :restore? true :command :insert-asset}))))) (p/finally @@ -1675,7 +1675,7 @@ last-command (and last-slash-caret-pos (subs edit-content last-slash-caret-pos pos))] (when (> pos 0) (or - (and (= (state/get-editor-command-trigger) (util/nth-safe edit-content (dec pos))) + (and (= commands/command-trigger (util/nth-safe edit-content (dec pos))) @commands/*initial-commands) (and last-command (commands/get-matched-commands last-command))))) @@ -1793,7 +1793,7 @@ id (get-link format link label) format - {:last-pattern (str (state/get-editor-command-trigger) "link") + {:last-pattern (str commands/command-trigger "link") :command :link}))) :image-link (let [{:keys [link label]} m] @@ -1802,7 +1802,7 @@ id (get-image-link format link label) format - {:last-pattern (str (state/get-editor-command-trigger) "link") + {:last-pattern (str commands/command-trigger "link") :command :image-link}))) nil) @@ -1879,7 +1879,7 @@ (-> (p/delay 10) (p/then #(state/pub-event! [:editor/toggle-own-number-list edit-block])))) - (and (= last-input-char (state/get-editor-command-trigger)) + (and (= last-input-char commands/command-trigger) (or (re-find #"(?m)^/" (str (.-value input))) (start-of-new-word? input pos))) (do (state/set-editor-action-data! {:pos (cursor/get-caret-pos input)}) @@ -2730,7 +2730,7 @@ (delete-block! repo false)))) (and (> current-pos 1) - (= (util/nth-safe value (dec current-pos)) (state/get-editor-command-trigger))) + (= (util/nth-safe value (dec current-pos)) commands/command-trigger)) (do (util/stop e) (commands/restore-state) @@ -3014,8 +3014,8 @@ (util/event-is-composing? e true)])] (cond ;; When you type something after / - (and (= :commands (state/get-editor-action)) (not= k (state/get-editor-command-trigger))) - (if (= (state/get-editor-command-trigger) (second (re-find #"(\S+)\s+$" value))) + (and (= :commands (state/get-editor-action)) (not= k commands/command-trigger)) + (if (= commands/command-trigger (second (re-find #"(\S+)\s+$" value))) (state/clear-editor-action!) (let [matched-commands (get-matched-commands input)] (if (seq matched-commands) diff --git a/src/main/frontend/state.cljs b/src/main/frontend/state.cljs index c079f245dd..5020180c04 100644 --- a/src/main/frontend/state.cljs +++ b/src/main/frontend/state.cljs @@ -426,15 +426,6 @@ should be done through this fn in order to get global config and config defaults (get-in @state [:me :preferred_format] "markdown"))))) -;; TODO: consider adding a pane in Settings to set this through the GUI (rather -;; than having to go through the config.edn file) -(defn get-editor-command-trigger - ([] (get-editor-command-trigger (get-current-repo))) - ([repo-url] - (or - (:editor/command-trigger (get-config repo-url)) ;; Get from user config - "/"))) ;; Set the default - (defn markdown? [] (= (keyword (get-preferred-format)) diff --git a/src/resources/dicts/en.edn b/src/resources/dicts/en.edn index 03eef0405c..8897092f18 100644 --- a/src/resources/dicts/en.edn +++ b/src/resources/dicts/en.edn @@ -192,6 +192,7 @@ :settings-page/auto-expand-block-refs "Expand block references automatically when zoom-in" :settings-page/custom-date-format "Preferred date format" :settings-page/custom-date-format-warning "Re-index required! Existing journal references would be broken!" + :settings-page/preferred-pasting-file-hint "When enabled, pasting an image from the internet will download and insert the image. When disabled, it will paste the link to the image." :settings-page/preferred-file-format "Preferred file format" :settings-page/preferred-workflow "Preferred workflow" :settings-page/preferred-pasting-file "Prefer pasting file" @@ -249,6 +250,89 @@ :search/publishing "Search" :search "Search or create page" :whiteboard/link-whiteboard-or-block "Link whiteboard/page/block" + :whiteboard/align-left "Align left" + :whiteboard/align-center-horizontally "Align center horizontally" + :whiteboard/align-right "Align right" + :whiteboard/distribute-horizontally "Distribute horizontally" + :whiteboard/align-top "Align top" + :whiteboard/align-center-vertically "Align center vertically" + :whiteboard/align-bottom "Align bottom" + :whiteboard/distribute-vertically "Distribute vertically" + :whiteboard/pack-into-rectangle "Pack into rectangle" + :whiteboard/zoom-to-fit "Zoom to fit" + :whiteboard/ungroup "Ungroup" + :whiteboard/group "Group" + :whiteboard/cut "Cut" + :whiteboard/copy "Copy" + :whiteboard/paste "Paste" + :whiteboard/paste-as-link "Paste as link" + :whiteboard/export "Export" + :whiteboard/select-all "Select all" + :whiteboard/deselect-all "Deselect all" + :whiteboard/lock "Lock" + :whiteboard/unlock "Unlock" + :whiteboard/delete "Delete" + :whiteboard/flip-horizontally "Flip horizontally" + :whiteboard/flip-vertically "Flip vertically" + :whiteboard/move-to-front "Move to front" + :whiteboard/move-to-back "Move to back" + :whiteboard/dev-print-shape-props "(Dev) Print shape props" + :whiteboard/auto-resize "Auto resize" + :whiteboard/expand "Expand" + :whiteboard/collapse "Collapse" + :whiteboard/website-url "Website url" + :whiteboard/reload "Reload" + :whiteboard/open-website-url "Open website url" + :whiteboard/youtube-url "YouTube url" + :whiteboard/open-youtube-url "Open YouTube url" + :whiteboard/twitter-url "Twitter url" + :whiteboard/open-twitter-url "Open Twitter url" + :whiteboard/fill "Fill" + :whiteboard/stroke-type "Stroke type" + :whiteboard/arrow-head "Arrow head" + :whiteboard/bold "Bold" + :whiteboard/italic "Italic" + :whiteboard/undo "Undo" + :whiteboard/redo "Redo" + :whiteboard/zoom-in "Zoom in" + :whiteboard/zoom-out "Zoom out" + :whiteboard/select "Select" + :whiteboard/pan "Pan" + :whiteboard/add-block-or-page "Add block or page" + :whiteboard/draw "Draw" + :whiteboard/highlight "Highlight" + :whiteboard/eraser "Eraser" + :whiteboard/connector "Connector" + :whiteboard/text "Text" + :whiteboard/color "Color" + :whiteboard/select-custom-color "Select custom color" + :whiteboard/opacity "Opacity" + :whiteboard/extra-small "Extra Small" + :whiteboard/small "Small" + :whiteboard/medium "Medium" + :whiteboard/large "Large" + :whiteboard/extra-large "Extra Large" + :whiteboard/huge "Huge" + :whiteboard/scale-level "Scale level" + :whiteboard/rectangle "Rectangle" + :whiteboard/circle "Circle" + :whiteboard/triangle "Triangle" + :whiteboard/shape "Shape" + :whiteboard/open-page "Open page" + :whiteboard/open-page-in-sidebar "Open page in sidebar" + :whiteboard/remove-link "Remove link" + :whiteboard/link "Link" + :whiteboard/references "References" + :whiteboard/link-to-any-page-or-block "Link to any page or block" + :whiteboard/start-typing-to-search "Start typing to search..." + :whiteboard/new-block-no-colon "New block" + :whiteboard/new-block "New block:" + :whiteboard/new-page "New page:" + :whiteboard/new-whiteboard "New whiteboard" + :whiteboard/search-only-blocks "Search only blocks" + :whiteboard/search-only-pages "Search only pages" + :whiteboard/cache-outdated "Cache is outdated. Please click the 'Re-index' button in the graph's dropdown menu." + :whiteboard/shape-quick-links "Shape Quick Links" :page-search "Search in the current page" :graph-search "Search graph" :home "Home" diff --git a/src/test/frontend/handler/common/config_edn_test.cljs b/src/test/frontend/handler/common/config_edn_test.cljs index c96e0be9cc..d8eb56d623 100644 --- a/src/test/frontend/handler/common/config_edn_test.cljs +++ b/src/test/frontend/handler/common/config_edn_test.cljs @@ -60,7 +60,7 @@ (deftest detect-deprecations (is (re-find - #":editor/command-trigger.*Will" + #":editor/command-trigger.*is" (deprecation-warnings-for "{:preferred-workflow :todo :editor/command-trigger \",\"}")) "Warning when there is a deprecation") diff --git a/tldraw/apps/tldraw-logseq/src/components/ActionBar/ActionBar.tsx b/tldraw/apps/tldraw-logseq/src/components/ActionBar/ActionBar.tsx index 86bf68cb60..51f4df3df0 100644 --- a/tldraw/apps/tldraw-logseq/src/components/ActionBar/ActionBar.tsx +++ b/tldraw/apps/tldraw-logseq/src/components/ActionBar/ActionBar.tsx @@ -8,9 +8,13 @@ import { TablerIcon } from '../icons' import { Button } from '../Button' import { ZoomMenu } from '../ZoomMenu' import * as Separator from '@radix-ui/react-separator' +import { LogseqContext } from '../../lib/logseq-context' export const ActionBar = observer(function ActionBar(): JSX.Element { const app = useApp() + const { + handlers: { t }, + } = React.useContext(LogseqContext) const undo = React.useCallback(() => { app.api.undo() @@ -32,20 +36,20 @@ export const ActionBar = observer(function ActionBar(): JSX.Element {
{!app.readOnly && (
- -
)}
- - diff --git a/tldraw/apps/tldraw-logseq/src/components/ContextBar/contextBarActionFactory.tsx b/tldraw/apps/tldraw-logseq/src/components/ContextBar/contextBarActionFactory.tsx index ce6f2197f1..d560f53840 100644 --- a/tldraw/apps/tldraw-logseq/src/components/ContextBar/contextBarActionFactory.tsx +++ b/tldraw/apps/tldraw-logseq/src/components/ContextBar/contextBarActionFactory.tsx @@ -92,13 +92,16 @@ function filterShapeByAction(type: ContextBarActionType) { const AutoResizingAction = observer(() => { const app = useApp() + const { + handlers: { t }, + } = React.useContext(LogseqContext) const shapes = filterShapeByAction('AutoResizing') const pressed = shapes.every(s => s.props.isAutoResizing) return ( s.props.type === 'logseq-portal')} className="tl-button" pressed={pressed} @@ -122,6 +125,9 @@ const AutoResizingAction = observer(() => { const LogseqPortalViewModeAction = observer(() => { const app = useApp() + const { + handlers: { t }, + } = React.useContext(LogseqContext) const shapes = filterShapeByAction('LogseqPortalViewMode') const collapsed = shapes.every(s => s.collapsed) @@ -131,7 +137,7 @@ const LogseqPortalViewModeAction = observer(() => { const tooltip = (
- {collapsed ? 'Expand' : 'Collapse'} + {collapsed ? t('whiteboard/expand') : t('whiteboard/collapse')} @@ -164,6 +170,9 @@ const ScaleLevelAction = observer(() => { const IFrameSourceAction = observer(() => { const app = useApp() + const { + handlers: { t }, + } = React.useContext(LogseqContext) const shape = filterShapeByAction('IFrameSource')[0] const handleChange = React.useCallback((e: React.ChangeEvent) => { @@ -177,16 +186,20 @@ const IFrameSourceAction = observer(() => { return ( - - @@ -195,6 +208,9 @@ const IFrameSourceAction = observer(() => { const YoutubeLinkAction = observer(() => { const app = useApp() + const { + handlers: { t }, + } = React.useContext(LogseqContext) const shape = filterShapeByAction('YoutubeLink')[0] const handleChange = React.useCallback((e: React.ChangeEvent) => { shape.onYoutubeLinkChange(e.target.value) @@ -204,13 +220,13 @@ const YoutubeLinkAction = observer(() => { return (
)}