Skip to content

v0.1.2

Latest

Choose a tag to compare

@junity233 junity233 released this 08 Jul 09:49
· 25 commits to master since this release
feat(packages): insert import at top of document (was copy-to-clipboard)

The PackageDetail "insert import" button previously copied the
#import snippet to the clipboard. Now it inserts the snippet at the very
top of the active document via a new MonacoEditorApi.insertAtTop method
(insert at line 1, push existing content down, place caret at end of the
inserted snippet, reveal + focus).

- MonacoEditor.tsx: add insertAtTop to the API interface + implementation
  (executeEdits at range 1:1, forceMoveMarkers, trailing newline).
- PackageDetail.tsx: button calls editorApiRef.current?.insertAtTop
  instead of navigator.clipboard.writeText.
- i18n: copyImport -> insertImport (en "Insert import" / zh "插入 import").