lostcoords-ui 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58faf78835a064bce2f360e849d8f521fe72af3a45a8df849819be70061d5b94
4
- data.tar.gz: aca66e424280f3a598e46c1900417ae8867ad48c59d1545ebecf93b252e4629f
3
+ metadata.gz: caddcd276d2386168c64c152b4a9ef90869134d7732b077768747e59ae8720a0
4
+ data.tar.gz: 0f6d891b4e6472734909b8c01d2e015d97d658fa9a13fa8311c53f29b3a5ae62
5
5
  SHA512:
6
- metadata.gz: 56d760f3b9b0b631f91a543e73ce0acda99b22975e2109aabb7d070480852e2117ed129ab471a588dd50330222cba0af6e63651aa3fbfc3ffa597c513366c8af
7
- data.tar.gz: 18ff62e5e64bb161d61e6982554c3b9985dd6ae6c7eb9d4e6b6e21a77a23540c0b37bb08efe145b6aa66375ed64735e5904239b2ff9c6c6a16319d2f6666cbc9
6
+ metadata.gz: 0a392785b70bef0fa5e1af81ab3d5e8a3dd6c7619bd6d3d1654cdbc3e16cebf0c7ca8a7cd256b2c7b58842a3faa3b18293f711008ae4a5c5a7d5227e77ef30b5
7
+ data.tar.gz: f4acbb4787e6d06cb69e0c79cf1da1bcedeebd46760d5b51f26513455c09bf03cbde8be802845f65bafb294eb4c446b5562429031d5b7a8775962d732a6583e9
data/README.md CHANGED
@@ -23,7 +23,7 @@ release and how to upgrade.
23
23
 
24
24
  ```ruby
25
25
  # Gemfile
26
- gem "lostcoords-ui", "~> 0.19.0"
26
+ gem "lostcoords-ui", "~> 0.20.0"
27
27
  ```
28
28
 
29
29
  ```css
@@ -131,7 +131,7 @@ Spacing has names: `tight`, `related`, `heading`, `content`, `inset`, `section`
131
131
  | Actions | `lc_button`, `lc_button_link_to`, `lc_button_to`, `lc_icon_button` (and `_link_to`, `_to`), `lc_split_button`, `lc_copy_button`, `lc_link` |
132
132
  | Forms | `lc_form_with`, `lc_field`, `lc_fieldset`, `lc_error_summary`, `lc_input`, `lc_textarea`, `lc_select`, `lc_select_trigger`, `lc_checkbox`, `lc_radio`, `lc_switch`, `lc_choice_group`, `lc_toggle`, `lc_toggle_group`, `lc_file_drop`, `lc_emoji_picker` |
133
133
  | Display | `lc_card`, `lc_alert`, `lc_badge`, `lc_avatar`, `lc_avatar_stack`, `lc_icon`, `lc_icon_badge`, `lc_empty_state`, `lc_spinner`, `lc_skeleton`, `lc_table`, `lc_description_list`, `lc_list_group` with `lc_list_row`, `lc_list_choice` and `lc_list_field`, `lc_row_link` |
134
- | Navigation | `lc_app_header`, `lc_dock`, `lc_nav_list`, `lc_tabs`, `lc_toc`, `lc_breadcrumb`, `lc_skip_link`, `lc_search` |
134
+ | Navigation | `lc_app_header`, `lc_dock`, `lc_nav_list`, `lc_tabs`, `lc_toc`, `lc_breadcrumb`, `lc_skip_link`, `lc_search`, `lc_docs_shell`, `lc_pager` |
135
135
  | Overlays | `lc_dialog`, `lc_sheet`, `lc_confirm_dialog`, `lc_menu`, `lc_popover`, `lc_tooltip`, `lc_toast`, `lc_picker_panel`, `lc_collapsible`, `lc_glass` |
136
136
  | Layout and text | `lc_container`, `lc_section`, `lc_section_header`, `lc_stack`, `lc_inline`, `lc_columns`, `lc_split`, `lc_heading`, `lc_text`, `lc_prose` |
137
137
 
@@ -245,6 +245,16 @@ figures. `anchors: true` links each heading that has an id to itself, and `lc_to
245
245
  the "On this page" list from the same HTML. A `.not-prose` element inside opts out. Tune it with
246
246
  `--lc-reading-size`, `--lc-reading-leading`, `--lc-reading-measure` and `--lc-reading-flow`.
247
247
 
248
+ A documentation site lays its pages out with `lc_docs_shell` and links them in order with
249
+ `lc_pager`:
250
+
251
+ ```erb
252
+ <%= lc_docs_shell navigation: render("navigation"), contents: lc_toc(headings: body) do %>
253
+ <%= lc_prose(anchors: true) { body } %>
254
+ <%= lc_pager previous: [ "Install", install_path ], next: [ "Theming", theming_path ] %>
255
+ <% end %>
256
+ ```
257
+
248
258
  ## The contract
249
259
 
250
260
  `Lostcoords::Ui::Contract.to_h` lists what an app may hook into: the classes and utilities, part
@@ -0,0 +1,87 @@
1
+ /* lc_docs_shell: a sidebar, the page and a contents column in one centred row. The sidebar shows
2
+ from lg and the contents from xl; both stay in view below the sticky chrome
3
+ (--lc-sticky-offset) and scroll on their own when they are taller than the screen. Below lg the
4
+ sidebar's navigation sits in a menu above the page. */
5
+ @layer components.lc {
6
+ .lc-docs-shell {
7
+ --_lc-docs-shell-top: var(--lc-sticky-offset, 0rem);
8
+
9
+ display: flex;
10
+ gap: --spacing(10);
11
+ inline-size: 100%;
12
+ max-inline-size: --spacing(360);
13
+ margin-inline: auto;
14
+ padding-inline: --spacing(5);
15
+
16
+ @variant sm { padding-inline: --spacing(8); }
17
+ @variant lg { padding-inline: --spacing(10); }
18
+
19
+ & > :is([data-slot="docs-shell-sidebar"], [data-slot="docs-shell-contents"]) {
20
+ position: sticky;
21
+ inset-block-start: var(--_lc-docs-shell-top);
22
+ display: none;
23
+ flex-shrink: 0;
24
+ block-size: calc(100dvh - var(--_lc-docs-shell-top));
25
+ overflow-y: auto;
26
+ }
27
+
28
+ & > [data-slot="docs-shell-sidebar"] {
29
+ inline-size: var(--lc-docs-shell-sidebar-width, --spacing(52));
30
+ padding-block: --spacing(8);
31
+ padding-inline-end: --spacing(4);
32
+
33
+ @variant lg { display: block; }
34
+ }
35
+
36
+ /* A column of what it holds, such as a toc above a list of related pages. */
37
+ & > [data-slot="docs-shell-contents"] {
38
+ flex-direction: column;
39
+ gap: var(--spacing-section);
40
+ inline-size: var(--lc-docs-shell-contents-width, --spacing(44));
41
+ padding-block: --spacing(12);
42
+ padding-inline-start: --spacing(4);
43
+
44
+ @variant xl { display: flex; }
45
+ }
46
+
47
+ & > [data-slot="docs-shell-main"] {
48
+ isolation: isolate;
49
+ flex: 1;
50
+ min-inline-size: 0;
51
+ padding-block: --spacing(5);
52
+ outline: none;
53
+
54
+ @variant lg { padding-block: --spacing(10); }
55
+ }
56
+
57
+ & [data-slot="docs-shell-menu"] {
58
+ position: relative;
59
+ z-index: var(--z-index-raised);
60
+
61
+ @variant lg { display: none; }
62
+
63
+ & > .lc-collapsible {
64
+ border-radius: --theme(--radius-2xl inline);
65
+ background: var(--muted);
66
+ }
67
+
68
+ & [data-slot="collapsible-summary"] {
69
+ min-block-size: var(--spacing-control-lg);
70
+ padding-inline: --spacing(4);
71
+ }
72
+
73
+ /* The navigation scrolls inside the open menu, so a long one never pushes the page away. */
74
+ & [data-slot="collapsible-content"] {
75
+ max-block-size: 60dvh;
76
+ padding: 0 --spacing(3) --spacing(3);
77
+ overflow-y: auto;
78
+ }
79
+ }
80
+
81
+ & [data-slot="docs-shell-page"] {
82
+ padding-block-start: --spacing(6);
83
+
84
+ @variant lg { padding-block-start: 0; }
85
+ }
86
+ }
87
+ }
@@ -0,0 +1,68 @@
1
+ /* lc_pager: the previous and next pages. cards puts each in a card of its own at either end of the
2
+ row, the next one on the end side even when there is no previous; icons is a pair of arrow
3
+ buttons. Arrows point the reading direction's way. */
4
+ @layer components.lc {
5
+ .lc-pager {
6
+ display: flex;
7
+ align-items: stretch;
8
+ justify-content: space-between;
9
+ gap: --theme(--spacing-related inline);
10
+
11
+ & svg {
12
+ flex-shrink: 0;
13
+ inline-size: --spacing(4);
14
+ block-size: --spacing(4);
15
+
16
+ &:dir(rtl) { scale: -1 1; }
17
+ }
18
+
19
+ /* The empty side keeps the next page at the end. */
20
+ & > span { flex: 1; }
21
+
22
+ &:not(.lc-pager--icons) > a {
23
+ display: flex;
24
+ flex: 1;
25
+ flex-basis: 0;
26
+ flex-direction: column;
27
+ gap: --theme(--spacing-tight inline);
28
+ min-inline-size: 0;
29
+ padding: --theme(--spacing-content inline);
30
+ border-radius: --theme(--radius-2xl inline);
31
+
32
+ /* A card's fill on the page; on a card or panel, the page's (see bg-tile). */
33
+ background: var(--lc-tile-bg, var(--card));
34
+ color: inherit;
35
+ text-decoration: none;
36
+
37
+ @apply lc-row-press;
38
+
39
+ @variant sm { max-inline-size: --spacing(80); }
40
+
41
+ &[data-slot="pager-next"] {
42
+ align-items: flex-end;
43
+ margin-inline-start: auto;
44
+ text-align: end;
45
+ }
46
+ }
47
+ }
48
+
49
+ .lc-pager--icons { justify-content: flex-start; }
50
+
51
+ [data-slot="pager-direction"] {
52
+ display: inline-flex;
53
+ align-items: center;
54
+ gap: --theme(--spacing-tight inline);
55
+ color: var(--muted-foreground);
56
+
57
+ @apply text-caption;
58
+ }
59
+
60
+ [data-slot="pager-title"] {
61
+ overflow: hidden;
62
+ max-inline-size: 100%;
63
+ text-overflow: ellipsis;
64
+ white-space: nowrap;
65
+
66
+ @apply text-label;
67
+ }
68
+ }
@@ -29,6 +29,7 @@
29
29
  .lc-input:not(.lc-input--filled, .lc-input--plain), .lc-input-group:not(.lc-input-group--filled), .lc-textarea, .lc-select select,
30
30
  button.lc-emoji-picker-choice:not([aria-pressed]),
31
31
  .lc-choice--card, .lc-list-group, .lc-row-link, .lc-panel, .lc-menu-item,
32
+ .lc-pager:not(.lc-pager--icons) > a, [data-slot="docs-shell-menu"] > .lc-collapsible,
32
33
  .lc-toggle-group--segmented, .lc-toggle-group--segmented :is([data-slot="toggle-group-item"], [role="tab"])
33
34
  ) {
34
35
  --_lc-squircle: 1.333;
@@ -42,6 +42,8 @@
42
42
  @import "../lostcoords/ui/components/nav-list.css";
43
43
  @import "../lostcoords/ui/components/tabs.css";
44
44
  @import "../lostcoords/ui/components/toc.css";
45
+ @import "../lostcoords/ui/components/docs-shell.css";
46
+ @import "../lostcoords/ui/components/pager.css";
45
47
  @import "../lostcoords/ui/components/panel.css";
46
48
  @import "../lostcoords/ui/components/split-button.css";
47
49
  @import "../lostcoords/ui/context.css";
@@ -0,0 +1,39 @@
1
+ module Lostcoords::Ui
2
+ module DocsShell
3
+ extend Component
4
+ component classes: %w[lc-docs-shell], controllers: %w[lc-scroll-keeper],
5
+ slots: %w[docs-shell docs-shell-contents docs-shell-main docs-shell-menu docs-shell-page docs-shell-sidebar],
6
+ variables: %w[--lc-docs-shell-contents-width --lc-docs-shell-sidebar-width]
7
+ option :navigation, "The sidebar, usually lc_nav_list; below lg it fills a menu above the page", required: true
8
+ option :contents, "The column beside the page from xl, usually lc_toc; it stacks whatever you pass, such as a toc above a list of related pages"
9
+ option :menu_label, "Names the menu that holds the navigation below lg", default: -> { Support.t("lostcoords.ui.docs_shell.menu") }
10
+ option :sidebar_label, "Names the sidebar", default: -> { Support.t("lostcoords.ui.docs_shell.sidebar") }
11
+ option :main_attributes, "Attributes for the <main>, such as a max width for a reading page", default: {}
12
+ removed :main, "use main_attributes:", "0.20.0"
13
+ end
14
+
15
+ module DocsShellHelper
16
+ # A documentation page: a sidebar of pages, the page, and a contents column. Below lg the
17
+ # sidebar's navigation moves into a menu above the page, and the contents column shows from xl.
18
+ # The sidebar and the contents stay in view as the page scrolls, below the app header's
19
+ # --lc-sticky-offset, and the sidebar keeps its scroll position from page to page.
20
+ def lc_docs_shell(**options, &block)
21
+ DocsShell.parse(options) => [ { navigation:, contents:, menu_label:, sidebar_label:, main_attributes: }, attributes ]
22
+ lc_label!(menu_label, :menu_label)
23
+ lc_label!(sidebar_label, :sidebar_label)
24
+ raise ArgumentError, "lc_docs_shell needs navigation:" if navigation.blank?
25
+ raise ArgumentError, "lc_docs_shell needs a block" unless block
26
+
27
+ menu = tag.div(lc_collapsible(title: menu_label, indicator: :chevron, card: false) { navigation }, data: { slot: "docs-shell-menu" })
28
+ main = tag.main(**lc_attributes({ id: "main", tabindex: -1, data: { slot: "docs-shell-main" } }, main_attributes)) do
29
+ safe_join([ menu, tag.div(capture(&block), data: { slot: "docs-shell-page" }) ])
30
+ end
31
+ sidebar = tag.aside(navigation, tabindex: 0, aria: { label: sidebar_label },
32
+ data: { slot: "docs-shell-sidebar", controller: "lc-scroll-keeper", lc_scroll_keeper_key_value: "lc-docs-shell" })
33
+
34
+ tag.div(**lc_attributes({ class: "lc-docs-shell", data: { slot: "docs-shell" } }, attributes)) do
35
+ safe_join([ sidebar, main, (tag.aside(contents, data: { slot: "docs-shell-contents" }) if contents.present?) ].compact)
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,49 @@
1
+ module Lostcoords::Ui
2
+ module Pager
3
+ extend Component
4
+ component classes: %w[lc-pager lc-pager--icons], slots: %w[pager pager-direction pager-next pager-previous pager-title]
5
+ option :previous, "The page before, as [title, url]; nil for none"
6
+ option :next, "The page after, as [title, url]; nil for none"
7
+ option :label, "Names the navigation", default: -> { Support.t("lostcoords.ui.pager.label") }
8
+ option :variant, "cards shows each page's title; icons is a pair of arrow buttons named by the pages, for a page's header", %i[cards icons]
9
+ removed :compact, "use variant: :icons", "0.20.0"
10
+
11
+ # Each side's arrow and link attributes.
12
+ LINKS = {
13
+ previous: { icon: "arrow-left", rel: "prev", data: { slot: "pager-previous" } },
14
+ next: { icon: "arrow-right", rel: "next", data: { slot: "pager-next" } }
15
+ }.freeze
16
+ end
17
+
18
+ module PagerHelper
19
+ # Links to the previous and next pages of a sequence, such as a guide's chapters. The links
20
+ # carry rel="prev" and rel="next".
21
+ def lc_pager(**options)
22
+ Pager.parse(options) => [ { previous:, next: following, label:, variant: }, attributes ]
23
+ lc_label!(label, :label)
24
+ raise ArgumentError, "lc_pager needs a previous or next page" if previous.nil? && following.nil?
25
+
26
+ links = { previous: previous, next: following }.map do |direction, page|
27
+ next tag.span(aria: { hidden: true }) if page.nil? && variant == :cards
28
+ next if page.nil?
29
+
30
+ lc_pager_link(direction, *page, variant)
31
+ end
32
+ tag.nav(safe_join(links.compact), **lc_attributes({ class: lc_class("lc-pager", (variant unless variant == :cards)), aria: { label: label }, data: { slot: "pager" } }, attributes))
33
+ end
34
+
35
+ private
36
+ def lc_pager_link(direction, title, url, variant)
37
+ lc_label!(title, :title)
38
+ word = lc_t("lostcoords.ui.pager.#{direction}")
39
+ link = Pager::LINKS.fetch(direction).except(:icon)
40
+ arrow = lc_icon(Pager::LINKS.dig(direction, :icon), variant: :mini)
41
+ return lc_icon_button_link_to("#{word}: #{title}", url, size: :sm, **link) { arrow } if variant == :icons
42
+
43
+ link_to(url, **link) do
44
+ tag.span(safe_join(direction == :previous ? [ arrow, word ] : [ word, arrow ]), data: { slot: "pager-direction" }) +
45
+ tag.span(title, data: { slot: "pager-title" })
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,53 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ // Keeps a scroll container's position across Turbo visits and reloads, such as
4
+ // a sidebar that every page renders again. Positions live in sessionStorage
5
+ // under the key value, so containers that share a key share a position.
6
+ // The current link scrolls into view whenever the restored position leaves it out of the frame.
7
+ export default class extends Controller {
8
+ static values = { key: String }
9
+
10
+ connect() {
11
+ this.save = () => this.store()
12
+ document.addEventListener("turbo:before-render", this.save)
13
+ window.addEventListener("pagehide", this.save)
14
+
15
+ const saved = Number.parseFloat(this.read())
16
+ if (Number.isFinite(saved)) this.element.scrollTop = saved
17
+ this.reveal(this.element.querySelector('[aria-current="page"]'))
18
+ }
19
+
20
+ disconnect() {
21
+ document.removeEventListener("turbo:before-render", this.save)
22
+ window.removeEventListener("pagehide", this.save)
23
+ }
24
+
25
+ // scrollIntoView would also scroll the page, so only the container moves.
26
+ reveal(link) {
27
+ if (!link) return
28
+ const frame = this.element.getBoundingClientRect()
29
+ const box = link.getBoundingClientRect()
30
+ if (box.top >= frame.top && box.bottom <= frame.bottom) return
31
+ this.element.scrollTop += box.top - frame.top - (frame.height - box.height) / 2
32
+ }
33
+
34
+ get storageKey() {
35
+ return `lostcoords-ui:scroll:${this.keyValue || this.element.id || "default"}`
36
+ }
37
+
38
+ read() {
39
+ try {
40
+ return sessionStorage.getItem(this.storageKey)
41
+ } catch {
42
+ return null
43
+ }
44
+ }
45
+
46
+ store() {
47
+ // A hidden container reports 0 and would overwrite the visible one's position.
48
+ if (!this.element.offsetParent) return
49
+ try {
50
+ sessionStorage.setItem(this.storageKey, String(this.element.scrollTop))
51
+ } catch {}
52
+ }
53
+ }
@@ -28,6 +28,13 @@ en:
28
28
  dismiss: "Dismiss"
29
29
  toc:
30
30
  label: "On this page"
31
+ docs_shell:
32
+ menu: "Menu"
33
+ sidebar: "Documentation sidebar"
34
+ pager:
35
+ label: "Pages"
36
+ previous: "Previous"
37
+ next: "Next"
31
38
  app_header:
32
39
  navigation: "Main"
33
40
  dock:
@@ -28,6 +28,13 @@ es:
28
28
  dismiss: "Cerrar"
29
29
  toc:
30
30
  label: "En esta página"
31
+ docs_shell:
32
+ menu: "Menú"
33
+ sidebar: "Barra lateral de la documentación"
34
+ pager:
35
+ label: "Páginas"
36
+ previous: "Anterior"
37
+ next: "Siguiente"
31
38
  app_header:
32
39
  navigation: "Principal"
33
40
  dock:
@@ -28,6 +28,13 @@ ja:
28
28
  dismiss: "閉じる"
29
29
  toc:
30
30
  label: "このページの内容"
31
+ docs_shell:
32
+ menu: "メニュー"
33
+ sidebar: "ドキュメントのサイドバー"
34
+ pager:
35
+ label: "ページ"
36
+ previous: "前へ"
37
+ next: "次へ"
31
38
  app_header:
32
39
  navigation: "メイン"
33
40
  dock:
@@ -1,5 +1,5 @@
1
1
  module Lostcoords
2
2
  module Ui
3
- VERSION = "0.19.0"
3
+ VERSION = "0.20.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lostcoords-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lost Coordinates
@@ -99,6 +99,7 @@ files:
99
99
  - app/assets/tailwind/lostcoords/ui/components/description-list.css
100
100
  - app/assets/tailwind/lostcoords/ui/components/dialog.css
101
101
  - app/assets/tailwind/lostcoords/ui/components/dock.css
102
+ - app/assets/tailwind/lostcoords/ui/components/docs-shell.css
102
103
  - app/assets/tailwind/lostcoords/ui/components/emoji-picker.css
103
104
  - app/assets/tailwind/lostcoords/ui/components/feedback.css
104
105
  - app/assets/tailwind/lostcoords/ui/components/field.css
@@ -111,6 +112,7 @@ files:
111
112
  - app/assets/tailwind/lostcoords/ui/components/link.css
112
113
  - app/assets/tailwind/lostcoords/ui/components/list-group.css
113
114
  - app/assets/tailwind/lostcoords/ui/components/nav-list.css
115
+ - app/assets/tailwind/lostcoords/ui/components/pager.css
114
116
  - app/assets/tailwind/lostcoords/ui/components/panel.css
115
117
  - app/assets/tailwind/lostcoords/ui/components/picker-panel.css
116
118
  - app/assets/tailwind/lostcoords/ui/components/prose.css
@@ -145,6 +147,7 @@ files:
145
147
  - app/helpers/lostcoords/ui/description_list_helper.rb
146
148
  - app/helpers/lostcoords/ui/dialog_helper.rb
147
149
  - app/helpers/lostcoords/ui/dock_helper.rb
150
+ - app/helpers/lostcoords/ui/docs_shell_helper.rb
148
151
  - app/helpers/lostcoords/ui/emoji_picker_helper.rb
149
152
  - app/helpers/lostcoords/ui/empty_state_helper.rb
150
153
  - app/helpers/lostcoords/ui/field_helper.rb
@@ -160,6 +163,7 @@ files:
160
163
  - app/helpers/lostcoords/ui/list_group_helper.rb
161
164
  - app/helpers/lostcoords/ui/menu_helper.rb
162
165
  - app/helpers/lostcoords/ui/nav_list_helper.rb
166
+ - app/helpers/lostcoords/ui/pager_helper.rb
163
167
  - app/helpers/lostcoords/ui/panel_helper.rb
164
168
  - app/helpers/lostcoords/ui/picker_panel_helper.rb
165
169
  - app/helpers/lostcoords/ui/popover_helper.rb
@@ -192,6 +196,7 @@ files:
192
196
  - app/javascript/lostcoords/ui/controllers/lc_menu_controller.js
193
197
  - app/javascript/lostcoords/ui/controllers/lc_nav_controller.js
194
198
  - app/javascript/lostcoords/ui/controllers/lc_popover_controller.js
199
+ - app/javascript/lostcoords/ui/controllers/lc_scroll_keeper_controller.js
195
200
  - app/javascript/lostcoords/ui/controllers/lc_search_controller.js
196
201
  - app/javascript/lostcoords/ui/controllers/lc_selection_controller.js
197
202
  - app/javascript/lostcoords/ui/controllers/lc_sheet_controller.js