You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/avo/skills/avo-fields/SKILL.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,6 +194,7 @@ end
194
194
195
195
-**Gem-gated types break without their companion gem** (the field silently fails to render or raises). If the user asks for one, tell them to add the gem:
Copy file name to clipboardExpand all lines: lib/avo/skills/avo-media-library/SKILL.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: avo-media-library
3
-
description: Turn on and manage Avo's Media Library — a central browser/manager for every uploaded asset, plus an asset picker inside the trix, rhino, and markdown rich-text editors — configured in config/initializers/avo.rb. Use when the user wants to "let users upload and manage images", "have one place to view and manage all our assets/uploads", "add an image or asset gallery to the admin", "insert/pick an existing image in the rich-text editor while writing content", "reuse uploaded images across records", "a digital asset manager for the admin", or "browse all the files I've uploaded" — and when they want to turn the Media Library on or off, hide or conditionally show its sidebar item, re-add it to a customized menu, or disable the gallery picker on a markdown field. Disabled by default and gated behind `defined?(Avo::MediaLibrary)`; Community license; currently in Alpha (breaking changes expected).
3
+
description: Turn on and manage Avo's Media Library — a central browser/manager for every uploaded asset, plus an asset picker inside the trix, rhino, markdown, and lexxy rich-text editors — configured in config/initializers/avo.rb. Use when the user wants to "let users upload and manage images", "have one place to view and manage all our assets/uploads", "add an image or asset gallery to the admin", "insert/pick an existing image in the rich-text editor while writing content", "reuse uploaded images across records", "a digital asset manager for the admin", or "browse all the files I've uploaded" — and when they want to turn the Media Library on or off, hide or conditionally show its sidebar item, re-add it to a customized menu, or disable the gallery picker on a markdown field. Disabled by default and gated behind `defined?(Avo::MediaLibrary)`; Community license; currently in Alpha (breaking changes expected).
The Media Library is a central place to browse and manage every asset uploaded to an Avo admin, and it doubles as an asset picker inside Avo's three rich-text editors (`trix`, `rhino`, `markdown`) — a button in each editor opens a modal, and the selected asset is injected into the content. It is **not a separate gem**: it ships inside Avo, gated behind `defined?(Avo::MediaLibrary)`, and is **disabled by default**. All configuration lives in `config/initializers/avo.rb`.
13
+
The Media Library is a central place to browse and manage every asset uploaded to an Avo admin, and it doubles as an asset picker inside Avo's rich-text editors (`trix`, `rhino`, `markdown`, `lexxy`) — a button in each editor opens a modal, and the selected asset is injected into the content. It is **not a separate gem**: it ships inside Avo, gated behind `defined?(Avo::MediaLibrary)`, and is **disabled by default**. All configuration lives in `config/initializers/avo.rb`.
14
14
15
15
**License:** Community (free). **Status:** Alpha — future releases may contain breaking changes, so tell the user this and point them at the upgrade guide when they adopt it.
16
16
17
17
**Docs** (fetch on demand — do not rely on memory for exact option names or defaults):
- Menu editor (for re-adding the item): https://docs.avohq.io/4.0/menu-editor.md
22
22
- Blocks / `Avo::Current` in config lambdas: https://docs.avohq.io/4.0/execution-context.md
23
23
@@ -26,7 +26,7 @@ The Media Library is a central place to browse and manage every asset uploaded t
26
26
Reach for this skill when the goal is either of the Media Library's two jobs:
27
27
28
28
1.**A central asset manager** — one screen to browse and manage all uploaded assets ("a gallery in the admin", "a digital asset manager", "see every file we've uploaded", "reuse images across records").
29
-
2.**An asset picker in the editors** — inserting or reusing an existing image while writing rich-text content in a `trix`, `rhino`, or `markdown` field.
29
+
2.**An asset picker in the editors** — inserting or reusing an existing image while writing rich-text content in a `trix`, `rhino`, `markdown`, or `lexxy` field.
30
30
31
31
Also use it for the on/off and visibility controls: enabling/disabling the whole feature, hiding or conditionally showing its sidebar item, re-adding it after the menu is customized, and toggling the picker off on a single markdown field.
32
32
@@ -86,18 +86,19 @@ end
86
86
end
87
87
```
88
88
89
-
5. **Use it with the editors.** Once enabled, every `trix`, `rhino`, and `markdown` field automatically gets a Media Library button in its toolbar — no per-field opt-in. Just declare the field as usual (this is **avo-fields** territory):
89
+
5. **Use it with the editors.** Once enabled, every `trix`, `rhino`, `markdown`, and `lexxy` field automatically gets a Media Library button in its toolbar — no per-field opt-in. Just declare the field as usual (this is **avo-fields** territory):
90
90
```ruby
91
91
field :body, as: :trix
92
92
field :body, as: :rhino
93
93
field :body, as: :markdown
94
+
field :body, as: :lexxy
94
95
```
95
96
96
97
6. **Disable the picker on a single markdown field (optional).** The `markdown` field accepts a `media_library` option (defaults to `true`). Set it to `false` to hide the gallery button on that one field while the Media Library stays enabled everywhere else:
97
98
```ruby
98
99
field :body, as: :markdown, media_library: false
99
100
```
100
-
This is **markdown-only** — `trix` and `rhino` have no per-field toggle. To remove the picker from those, the only lever is the global killswitch.
101
+
This is **markdown-only** — `trix` and `rhino` have no per-field toggle. To remove the picker from those, the only lever is the global killswitch. The `lexxy` field hides its button when attachments are disabled (`attachments_disabled: true`, the default on plain columns).
101
102
102
103
7. **Report** what you changed (see below). No need to run the app; a `ruby -c` on the initializer is enough to sanity-check syntax.
103
104
@@ -108,7 +109,7 @@ end
108
109
-**`config.enabled` is an all-or-nothing killswitch.**Flipping it off hides the menu item, blocks the routes, *and* hides the editor icons — for everyone. There is no per-user or per-resource enable; use `config.visible` (a block) if you only want to gate who *sees the menu item*.
109
110
-**`enabled`and`visible` are different levers.**`enabled`= whole feature on/off. `visible`= just the sidebar item (Booleanor block). Hiding the item with `visible = false` does not disable uploads or the editor picker.
110
111
-**A customized menu drops the item.**If`config.main_menu` is defined, the MediaLibrary sidebar item won't appear on its own — re-add it manually with `link_to "Media Library", avo.media_library_index_path`.
111
-
- **`media_library: false` is markdown-only.** `trix` and `rhino` don't support per-field toggling; the killswitch is the only way to remove their buttons.
112
+
- **`media_library: false` is markdown-only.** `trix` and `rhino` don't support per-field toggling; the killswitch is the only way to remove their buttons.`lexxy` follows its own `attachments_disabled` option.
112
113
-**It's `Avo::MediaLibrary.configure`, not `Avo.configure`.** The enable/visible settings live on their own configuration object. Only the menu `link_to` goes inside the main `Avo.configure` block.
0 commit comments