@wildwinter/app-shell 0.15.0 → 0.17.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/dist/chunk-YLINCOQD.js +39 -0
- package/dist/chunk-YLINCOQD.js.map +1 -0
- package/dist/index.cjs +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/menu.cjs +26 -0
- package/dist/menu.cjs.map +1 -1
- package/dist/menu.d.cts +56 -1
- package/dist/menu.d.ts +56 -1
- package/dist/menu.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-R6RO5TXB.js +0 -16
- package/dist/chunk-R6RO5TXB.js.map +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/menu.ts
|
|
2
|
+
var EDIT_MENU = {
|
|
3
|
+
undo: { label: "Undo", accelerator: "CmdOrCtrl+Z" },
|
|
4
|
+
redo: { label: "Redo", accelerator: "Shift+CmdOrCtrl+Z" },
|
|
5
|
+
duplicate: { label: "Duplicate", accelerator: "CmdOrCtrl+D" },
|
|
6
|
+
find: { label: "Find\u2026", accelerator: "CmdOrCtrl+F" }
|
|
7
|
+
};
|
|
8
|
+
var PANE_MENU = {
|
|
9
|
+
showNav: { label: "Show Navigator", accelerator: "CmdOrCtrl+1" },
|
|
10
|
+
showInspector: { label: "Show Inspector", accelerator: "CmdOrCtrl+2" },
|
|
11
|
+
resetView: { label: "Reset View" }
|
|
12
|
+
};
|
|
13
|
+
var HELP_MENU = {
|
|
14
|
+
checkForUpdates: { label: "Check for Updates\u2026" }
|
|
15
|
+
};
|
|
16
|
+
var APP_MENU = {
|
|
17
|
+
/** Name + optional email, used to sign edits and comments. One label across the suite. */
|
|
18
|
+
userInfo: { label: "User Information\u2026" }
|
|
19
|
+
};
|
|
20
|
+
function namedMenuItems(naming) {
|
|
21
|
+
const suite = naming.suiteName ?? "Patter";
|
|
22
|
+
return {
|
|
23
|
+
about: { label: `About ${naming.appName}`, ready: true },
|
|
24
|
+
docs: {
|
|
25
|
+
label: `${naming.appName} Documentation`,
|
|
26
|
+
...naming.docsUrl ? { url: naming.docsUrl } : {},
|
|
27
|
+
ready: naming.docsUrl !== void 0
|
|
28
|
+
},
|
|
29
|
+
suiteDocs: {
|
|
30
|
+
label: `${suite} Documentation Home`,
|
|
31
|
+
...naming.suiteDocsUrl ? { url: naming.suiteDocsUrl } : {},
|
|
32
|
+
ready: naming.suiteDocsUrl !== void 0
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { APP_MENU, EDIT_MENU, HELP_MENU, PANE_MENU, namedMenuItems };
|
|
38
|
+
//# sourceMappingURL=chunk-YLINCOQD.js.map
|
|
39
|
+
//# sourceMappingURL=chunk-YLINCOQD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/menu.ts"],"names":[],"mappings":";AA2BO,IAAM,SAAA,GAKT;AAAA,EACF,IAAA,EAAM,EAAE,KAAA,EAAO,MAAA,EAAQ,aAAa,aAAA,EAAc;AAAA,EAClD,IAAA,EAAM,EAAE,KAAA,EAAO,MAAA,EAAQ,aAAa,mBAAA,EAAoB;AAAA,EACxD,SAAA,EAAW,EAAE,KAAA,EAAO,WAAA,EAAa,aAAa,aAAA,EAAc;AAAA,EAC5D,IAAA,EAAM,EAAE,KAAA,EAAO,YAAA,EAAS,aAAa,aAAA;AACvC;AAGO,IAAM,SAAA,GAIT;AAAA,EACF,OAAA,EAAS,EAAE,KAAA,EAAO,gBAAA,EAAkB,aAAa,aAAA,EAAc;AAAA,EAC/D,aAAA,EAAe,EAAE,KAAA,EAAO,gBAAA,EAAkB,aAAa,aAAA,EAAc;AAAA,EACrE,SAAA,EAAW,EAAE,KAAA,EAAO,YAAA;AACtB;AAkBO,IAAM,SAAA,GAET;AAAA,EACF,eAAA,EAAiB,EAAE,KAAA,EAAO,yBAAA;AAC5B;AAGO,IAAM,QAAA,GAET;AAAA;AAAA,EAEF,QAAA,EAAU,EAAE,KAAA,EAAO,wBAAA;AACrB;AA+BO,SAAS,eAAe,MAAA,EAI7B;AACA,EAAA,MAAM,KAAA,GAAQ,OAAO,SAAA,IAAa,QAAA;AAClC,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,EAAE,KAAA,EAAO,CAAA,MAAA,EAAS,OAAO,OAAO,CAAA,CAAA,EAAI,OAAO,IAAA,EAAK;AAAA,IACvD,IAAA,EAAM;AAAA,MACJ,KAAA,EAAO,CAAA,EAAG,MAAA,CAAO,OAAO,CAAA,cAAA,CAAA;AAAA,MACxB,GAAI,OAAO,OAAA,GAAU,EAAE,KAAK,MAAA,CAAO,OAAA,KAAY,EAAC;AAAA,MAChD,KAAA,EAAO,OAAO,OAAA,KAAY;AAAA,KAC5B;AAAA,IACA,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,GAAG,KAAK,CAAA,mBAAA,CAAA;AAAA,MACf,GAAI,OAAO,YAAA,GAAe,EAAE,KAAK,MAAA,CAAO,YAAA,KAAiB,EAAC;AAAA,MAC1D,KAAA,EAAO,OAAO,YAAA,KAAiB;AAAA;AACjC,GACF;AACF","file":"chunk-YLINCOQD.js","sourcesContent":["// ---------------------------------------------------------------------------\n// Shell-owned menu naming: the labels + accelerators for the pane-frame menu\n// items, single-sourced so every app in the family names them identically\n// (and a rename here flows to all of them). Pure data - no electron, no DOM -\n// so a main-process menu builder can import it. Each app builds its own\n// MenuItem from these and wires the click to its shell controller.\n// ---------------------------------------------------------------------------\n\nexport interface MenuLabel {\n label: string;\n /** Electron accelerator string, when the item has one. */\n accelerator?: string;\n}\n\n/**\n * The Edit menu items the family shares.\n *\n * Undo and Redo are here and the MECHANISM is not, which is the whole finding\n * about undo: Patterpad's is ProseMirror's document history, Storyletter's is a\n * replay of file bytes, and those have nothing in common but this. See\n * `design/shared-shell.md`.\n *\n * The rule both apps discovered separately, and the reason these are spelled\n * out rather than left as Electron's `role: \"undo\"`: the native role runs a DOM\n * text-field undo, which knows nothing about either app's model and will\n * silently undo the wrong thing.\n */\nexport const EDIT_MENU: {\n undo: MenuLabel;\n redo: MenuLabel;\n duplicate: MenuLabel;\n find: MenuLabel;\n} = {\n undo: { label: \"Undo\", accelerator: \"CmdOrCtrl+Z\" },\n redo: { label: \"Redo\", accelerator: \"Shift+CmdOrCtrl+Z\" },\n duplicate: { label: \"Duplicate\", accelerator: \"CmdOrCtrl+D\" },\n find: { label: \"Find…\", accelerator: \"CmdOrCtrl+F\" },\n};\n\n/** The pane-frame menu items (a View menu, conventionally). */\nexport const PANE_MENU: {\n showNav: MenuLabel;\n showInspector: MenuLabel;\n resetView: MenuLabel;\n} = {\n showNav: { label: \"Show Navigator\", accelerator: \"CmdOrCtrl+1\" },\n showInspector: { label: \"Show Inspector\", accelerator: \"CmdOrCtrl+2\" },\n resetView: { label: \"Reset View\" },\n};\n\n/**\n * The Help menu items the family shares, and the one platform rule that goes\n * with them.\n *\n * Lifted from Patterpad, which is the only app that has ever had these: a\n * second app writing its own updater or About is pure waste (`design/\n * shared-shell.md`), and a suite is recognised by finding Check for Updates\n * where you left it. Storyletter will grow both; until it does, these labels\n * are the agreement rather than a description of two implementations.\n *\n * PLACEMENT, which differs by platform and is easy to get wrong:\n * - macOS keeps About in the APP menu (the one named after the product), and\n * Help carries documentation + Check for Updates only.\n * - Windows and Linux have no app menu, so About goes at the foot of Help,\n * after a separator. That is the conventional home there.\n */\nexport const HELP_MENU: {\n checkForUpdates: MenuLabel;\n} = {\n checkForUpdates: { label: \"Check for Updates\\u2026\" },\n};\n\n/** The app-menu items the family shares (macOS; the identity item also belongs in File elsewhere). */\nexport const APP_MENU: {\n userInfo: MenuLabel;\n} = {\n /** Name + optional email, used to sign edits and comments. One label across the suite. */\n userInfo: { label: \"User Information\\u2026\" },\n};\n\n/** What an app must tell the shell to build its named menu items. */\nexport interface MenuNaming {\n /** The product, as it appears in menus: \"Patterpad\", \"Storyletter\". */\n appName: string;\n /** The product's own documentation URL. Omit while an app has no docs yet and\n * the item is rendered disabled rather than opening a broken link. */\n docsUrl?: string;\n /** The suite's documentation home, shared by every app in the family. */\n suiteDocsUrl?: string;\n /** The suite, as it appears in \"<suite> Documentation Home\". Defaults to \"Patter\". */\n suiteName?: string;\n}\n\n/** A named menu item: the label, plus the URL it opens (absent = nothing wired yet). */\nexport interface NamedMenuItem extends MenuLabel {\n url?: string;\n /** False when the app has not supplied a URL, so the builder can render it\n * disabled instead of opening nothing. A placeholder, honestly labelled. */\n ready: boolean;\n}\n\n/**\n * The menu labels that carry a product or suite name, so no app spells its own\n * About or Documentation item differently from the rest of the family.\n *\n * An app with no documentation site yet still gets the ITEM, marked\n * `ready: false`, so the menu has its family shape from day one and wiring the\n * URL later is a one-line change rather than a menu redesign.\n */\nexport function namedMenuItems(naming: MenuNaming): {\n about: NamedMenuItem;\n docs: NamedMenuItem;\n suiteDocs: NamedMenuItem;\n} {\n const suite = naming.suiteName ?? \"Patter\";\n return {\n about: { label: `About ${naming.appName}`, ready: true },\n docs: {\n label: `${naming.appName} Documentation`,\n ...(naming.docsUrl ? { url: naming.docsUrl } : {}),\n ready: naming.docsUrl !== undefined,\n },\n suiteDocs: {\n label: `${suite} Documentation Home`,\n ...(naming.suiteDocsUrl ? { url: naming.suiteDocsUrl } : {}),\n ready: naming.suiteDocsUrl !== undefined,\n },\n };\n}\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -136,6 +136,15 @@ var icon = {
|
|
|
136
136
|
dot: "\u25CF",
|
|
137
137
|
/** Play, in the sense of "run this". */
|
|
138
138
|
play: "\u25B6",
|
|
139
|
+
/** Start the thing again from the top: a play session, a sweep. Named for the
|
|
140
|
+
* act, not the arrow, which is the table's rule. */
|
|
141
|
+
restart: "\u27F2",
|
|
142
|
+
/** The three ways a collection can be shown. Named by what you get rather than
|
|
143
|
+
* by the glyph, so a second app can pick the same three without copying
|
|
144
|
+
* somebody's taste in symbols. */
|
|
145
|
+
viewCards: "\u25A6",
|
|
146
|
+
viewTable: "\u2630",
|
|
147
|
+
viewNode: "\u25C8",
|
|
139
148
|
// --- handling -------------------------------------------------------------
|
|
140
149
|
/** The drag grip on a reorderable row. */
|
|
141
150
|
grip: "\u283F",
|