Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
preview related ui elements
Browse files Browse the repository at this point in the history
  • Loading branch information
amitu committed Sep 16, 2024
1 parent bd8c41f commit 58a269b
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 4 deletions.
6 changes: 5 additions & 1 deletion components/editor/command-k/command.grammar
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@top command {
AddFile | ClearOPFS | PushFile | DeleteFile
AddFile | ClearOPFS | PushFile | DeleteFile | UpdatePreview
}


Expand All @@ -21,6 +21,10 @@ ClearOPFS {
"clear-opfs"
}

UpdatePreview {
"update-preview"
}

FileName {
folder? identifier '.' identifier
}
Expand Down
28 changes: 28 additions & 0 deletions components/editor/command-k/index.ftd
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,34 @@ clear-opfs



-- component show-update-preview-help:
caption boolean show-question: false

-- ftd.column:
width: fill-container
spacing.fixed.px: 5
padding.px: 5

-- help-header: Update Preview
show-question: $show-update-preview-help.show-question

-- ftd.text:

You can update the preview by using this command. When you type we don't
auto update the preview due to performance reason. You can use this command
to update the preview.

-- ftd.code:
width: fill-container
lang: sh

update-preview

-- end: ftd.column

-- end: show-update-preview-help





Expand Down
2 changes: 1 addition & 1 deletion components/editor/editor-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components/editor/editor-bundle.js.map

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion components/editor/panels/preview.ftd
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,21 @@ padding-horizontal.px: 10
padding-vertical.px: 6


-- ftd.text: Preview
-- ftd.row:
spacing.fixed.px: 7
align-content: center

-- phosphor.light: seal-check
if: { vars.preview-upto-date }
size: 14

-- phosphor.light: seal
if: { !vars.preview-upto-date }
size: 14

-- ftd.text: Preview

-- end: ftd.row

-- ftd.row:
spacing.fixed.px: 5
Expand Down
2 changes: 2 additions & 0 deletions components/editor/vars.ftd
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ url: /foo/blog/images/first-image.jpg



-- boolean $preview-upto-date: true

-- boolean $preview-maximized: false

-- boolean $preview-visible: true
Expand Down

0 comments on commit 58a269b

Please sign in to comment.