@appsoftwareltd/etherpk-extension-api 0.20.0 → 0.22.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.
package/README.md CHANGED
@@ -89,7 +89,11 @@ These are the Stable parts of the context.
89
89
 
90
90
  `context.commands.register(id, handler)` adds a Command, whose id starts with the extension's id
91
91
  (`hello.greet`). `context.commandMenu.register(item)` adds a row to the `/` menu that runs a Command.
92
- A row can have a `detail` line, an `icon`, `keywords` that find it, a `group` and an `order`. Its
92
+ A row can have a `detail` line, an `icon`, `keywords` that find it, a `group` and an `order`. The
93
+ menu lists its rows under three headings, in this order: `Insert`, `Go to` and `Settings`. A row's
94
+ `group` names the one it belongs under, and its `order` places it among the other rows there, lower
95
+ first. A row with no `group`, or with any other text in it, is listed under `Insert` when it sets
96
+ `actsOnText` and under `Go to` otherwise. Its
93
97
  `when(menu)` says whether it is offered at the caret, from what `menu` reports: `bodyWritable`,
94
98
  `inTable` and `protectedDocument`. A row that only acts on the text at the caret, inserting or
95
99
  formatting it, sets `actsOnText: true`; only such rows are offered in an editor that shows part of a
@@ -414,7 +418,7 @@ thumbnail.addEventListener('click', () => void context.assets.viewImages({ refs:
414
418
  ### Icons
415
419
 
416
420
  `context.icons.svg(name)` draws one of the extension's own icons or one of the Client's, as markup the
417
- Client trusts. The Client's icons, which every `icon` field may name too, are `alias`, `archive`, `backlinks`, `bold`, `bookmark`, `bullet`, `calendar`, `check`, `clock`, `close`, `code`, `copy`, `download`, `fit`, `flag`, `fold`, `frontmatter`, `globe`, `graph`, `grip`, `headless-client`, `highlight`, `image`, `import`, `indent`, `italic`, `list`, `lock`, `lock-open`, `more`, `move`, `move-down`, `move-up`, `new-page`, `open-external`, `outdent`, `page`, `pdf`, `pdf-eraser`, `pdf-hand`, `pdf-highlighter`, `pdf-note`, `pdf-page-next`, `pdf-page-previous`, `pdf-full-screen-exit`, `pdf-save`, `pdf-select`, `pdf-pen`, `pdf-print`, `pdf-signature`, `pageless`, `pane-below`, `pane-right`, `pin`, `redo`, `rename`, `reset`, `search`, `slash`, `spell-check`, `table`, `table-add-column`, `table-add-row`, `table-format`, `table-remove-column`, `table-remove-row`, `tag`, `task`, `task-reference`, `template`, `text-lines`, `today`, `todays-journal`, `tomorrow`, `trash`, `undo`, `view-larger`, `wikilink-close`, `wikilink-open`, `yesterday`, `zoom-in`, `zoom-out`. An
421
+ Client trusts. The Client's icons, which every `icon` field may name too, are `alias`, `archive`, `backlinks`, `bold`, `book`, `bookmark`, `bullet`, `calendar`, `check`, `clock`, `close`, `code`, `copy`, `download`, `ebook-back`, `ebook-read-aloud`, `ebook-text-size`, `fit`, `flag`, `fold`, `frontmatter`, `globe`, `graph`, `grip`, `headless-client`, `highlight`, `hourglass`, `image`, `import`, `indent`, `italic`, `list`, `lock`, `lock-open`, `more`, `move`, `move-down`, `move-up`, `new-page`, `open-external`, `outdent`, `page`, `pdf`, `pdf-eraser`, `pdf-hand`, `pdf-highlighter`, `pdf-note`, `pdf-page-next`, `pdf-page-previous`, `pdf-full-screen-exit`, `pdf-save`, `pdf-select`, `pdf-pen`, `pdf-print`, `pdf-signature`, `pageless`, `pane-below`, `pane-right`, `pin`, `redo`, `rename`, `reset`, `search`, `slash`, `spell-check`, `table`, `table-add-column`, `table-add-row`, `table-format`, `table-remove-column`, `table-remove-row`, `tag`, `task`, `task-reference`, `template`, `text-lines`, `today`, `todays-journal`, `tomorrow`, `trash`, `undo`, `view-larger`, `wikilink-close`, `wikilink-open`, `yesterday`, `zoom-in`, `zoom-out`. An
418
422
  icon may be added in a later release, never taken away. An unknown name draws a small dot.
419
423
 
420
424
  ### Settings sections
package/dist/menus.d.ts CHANGED
@@ -145,9 +145,17 @@ export interface CommandMenuItem {
145
145
  detail?: string | ((context: CommandMenuContext) => string | undefined);
146
146
  /** An icon drawn before the title: the extension's own or one of the Client's. */
147
147
  icon?: string;
148
- /** Rows are grouped under this heading. */
148
+ /**
149
+ * The heading the row is listed under: `'Insert'` for a row that puts something in the document,
150
+ * `'Go to'` for one that opens a View or a panel or finds something, or `'Settings'` for one that
151
+ * changes how EtherPK behaves. The menu lists the three in that order. Absent, or any other
152
+ * text, the row is listed under Insert when it sets `actsOnText` and under Go to otherwise.
153
+ */
149
154
  group?: string;
150
- /** Lower sorts earlier within the group. */
155
+ /**
156
+ * Lower sorts earlier within the group, among the Client's rows and other extensions'. Absent,
157
+ * the row comes after every row of its group that has one.
158
+ */
151
159
  order?: number;
152
160
  /** More words the menu's filter matches. */
153
161
  keywords?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsoftwareltd/etherpk-extension-api",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "license": "MIT",
5
5
  "description": "The API an EtherPK extension is written against: the context it is started with, its manifest, and the contract its Views follow.",
6
6
  "type": "module",