@kubohiroya/turbowarp-title-menu 0.2.1 → 0.2.2

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.ja.md CHANGED
@@ -33,7 +33,7 @@ IndexedDBはoriginごとに分かれます。TurboWarp Web、TurboWarp Desktop
33
33
  ## インストール
34
34
 
35
35
  ```bash
36
- pnpm add --save-exact @kubohiroya/turbowarp-title-menu@0.2.1
36
+ pnpm add --save-exact @kubohiroya/turbowarp-title-menu@0.2.2
37
37
  ```
38
38
 
39
39
  TurboWarpでは `dist/turbowarp-title-menu.js` をCustom Extensionとして読み込み、sandboxなしの実行を許可します。
package/README.md CHANGED
@@ -48,7 +48,7 @@ The reviewed JavaScript build is committed to this repository, so users do not n
48
48
  Install an exact version that you have reviewed:
49
49
 
50
50
  ```bash
51
- pnpm add --save-exact @kubohiroya/turbowarp-title-menu@0.2.1
51
+ pnpm add --save-exact @kubohiroya/turbowarp-title-menu@0.2.2
52
52
  ```
53
53
 
54
54
  Load the standalone bundle from:
@@ -60,7 +60,7 @@ node_modules/@kubohiroya/turbowarp-title-menu/dist/turbowarp-title-menu.js
60
60
  A version-pinned CDN URL is:
61
61
 
62
62
  ```text
63
- https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-title-menu@0.2.1/dist/turbowarp-title-menu.js
63
+ https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-title-menu@0.2.2/dist/turbowarp-title-menu.js
64
64
  ```
65
65
 
66
66
  ## Quick start
@@ -101,7 +101,7 @@
101
101
  "menus": [
102
102
  {
103
103
  "id": "menuActions",
104
- "acceptReporters": true
104
+ "acceptReporters": false
105
105
  }
106
106
  ]
107
107
  }
@@ -1183,7 +1183,7 @@
1183
1183
  });
1184
1184
  }
1185
1185
  const extensionName = "TurboWarp Title Menu";
1186
- const menus = { "menuActions": { "acceptReporters": true, "items": "menuActionItems" } };
1186
+ const menus = { "menuActions": { "acceptReporters": false, "items": "menuActionItems" } };
1187
1187
  const blocks = [{ "opcode": "showTitle", "blockType": "COMMAND", "text": "show title dialog", "description": "Shows the configured title dialog above the TurboWarp stage." }, { "opcode": "showMenu", "blockType": "COMMAND", "text": "show application menu", "description": "Shows the application menu above the TurboWarp stage." }, { "opcode": "addAppMenuAction", "blockType": "COMMAND", "text": "add app menu action [ACTION] labelled [LABEL]", "description": "Adds an application menu action this project owns, or relabels one it already added.", "arguments": { "ACTION": { "type": "STRING", "defaultValue": "start" }, "LABEL": { "type": "STRING", "defaultValue": "Start" } } }, { "opcode": "clearAppMenuActions", "blockType": "COMMAND", "text": "clear app menu actions", "description": "Removes every application menu action, including the built-in ones, so a project can define its own set." }, { "opcode": "setAppMenuActionEnabled", "blockType": "COMMAND", "text": "set app menu action [ACTION] enabled [ENABLED]", "description": "Enables or disables one application menu action.", "arguments": { "ACTION": { "type": "STRING", "menu": "menuActions" }, "ENABLED": { "type": "BOOLEAN", "defaultValue": true } } }, { "opcode": "whenAppMenuActionSelected", "blockType": "HAT", "text": "when app menu action [ACTION] selected", "description": "Runs when the operator selects the named application menu action.", "arguments": { "ACTION": { "type": "STRING", "menu": "menuActions" } } }, { "opcode": "showDslFiles", "blockType": "COMMAND", "text": "show DSL file manager", "description": "Shows the dialog that adds, opens, renames, deletes, and sorts stored DSL files." }, { "opcode": "whenDslSourceOpened", "blockType": "HAT", "text": "when a DSL source is opened", "description": "Runs after the operator opens a stored DSL file, or after the opened source is announced again." }, { "opcode": "reloadOpenedDsl", "blockType": "COMMAND", "text": "reload the opened DSL source", "description": "Announces the currently opened DSL source again without showing a dialog." }, { "opcode": "openedDslName", "blockType": "REPORTER", "text": "opened DSL file name", "description": "Returns the name of the DSL file that is currently open, or an empty string." }, { "opcode": "openedDslSource", "blockType": "REPORTER", "text": "opened DSL source", "description": "Returns the text of the DSL file that is currently open, or an empty string." }, { "opcode": "hasSavedDsl", "blockType": "BOOLEAN", "text": "has a saved DSL file?", "description": "Reports whether at least one DSL file is stored in IndexedDB." }, { "opcode": "savedDslCount", "blockType": "REPORTER", "text": "saved DSL file count", "description": "Returns how many DSL files are stored in IndexedDB." }, { "opcode": "lastDslError", "blockType": "REPORTER", "text": "last DSL storage error", "description": "Returns the most recent DSL storage failure in the interface language, or an empty string." }];
1188
1188
  const definitions = {
1189
1189
  extensionName,
@@ -1319,7 +1319,14 @@
1319
1319
  this.ensureApplicationMenu().show(this.locale());
1320
1320
  this.menuVisible = true;
1321
1321
  }
1322
- /** Backs the dynamic `menuActions` dropdown, so it always lists what the project registered. */
1322
+ /**
1323
+ * Backs the dynamic `menuActions` dropdown, so it always lists what the project registered.
1324
+ *
1325
+ * The menu must refuse reporters. Scratch turns a reporter-accepting menu argument into an input
1326
+ * holding a shadow block, and `startHats` matches a hat against its *fields*, so the action hat
1327
+ * would never fire for a specific action. Refusing reporters keeps the argument an inline
1328
+ * dropdown, which is what the match reads.
1329
+ */
1323
1330
  menuActionItems() {
1324
1331
  if (this.menuActions.length === 0) return [{ text: "—", value: "" }];
1325
1332
  const locale = this.locale();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-title-menu",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Reusable title, application menu, and DSL source storage controls for TurboWarp.",
5
5
  "author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
6
6
  "license": "MPL-2.0",
@@ -2,7 +2,7 @@
2
2
  "extensionName": "TurboWarp Title Menu",
3
3
  "menus": {
4
4
  "menuActions": {
5
- "acceptReporters": true,
5
+ "acceptReporters": false,
6
6
  "items": "menuActionItems"
7
7
  }
8
8
  },
package/src/extension.ts CHANGED
@@ -94,7 +94,14 @@ export class TurboWarpTitleMenuExtension implements TurboWarpExtension {
94
94
  this.menuVisible = true;
95
95
  }
96
96
 
97
- /** Backs the dynamic `menuActions` dropdown, so it always lists what the project registered. */
97
+ /**
98
+ * Backs the dynamic `menuActions` dropdown, so it always lists what the project registered.
99
+ *
100
+ * The menu must refuse reporters. Scratch turns a reporter-accepting menu argument into an input
101
+ * holding a shadow block, and `startHats` matches a hat against its *fields*, so the action hat
102
+ * would never fire for a specific action. Refusing reporters keeps the argument an inline
103
+ * dropdown, which is what the match reads.
104
+ */
98
105
  public menuActionItems(): Array<{text: string; value: string}> {
99
106
  if (this.menuActions.length === 0) return [{text: '\u2014', value: ''}];
100
107
  const locale = this.locale();