@noldova/desktop.window 0.0.2 → 0.0.3

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.
Files changed (118) hide show
  1. package/api/index.d.ts +3 -0
  2. package/api/index.js +3 -0
  3. package/api/index.js.map +1 -1
  4. package/app/components/placeholder-content/placeholder-content.component.js +2 -1
  5. package/app/components/placeholder-content/placeholder-content.component.js.map +1 -1
  6. package/app/components/search-palette/search-palette.component.js +2 -2
  7. package/app/components/search-palette/search-palette.component.js.map +1 -1
  8. package/app/components/settings/settings.component.d.ts +1 -0
  9. package/app/components/settings/settings.component.js +7 -1
  10. package/app/components/settings/settings.component.js.map +1 -1
  11. package/app/components/settings-page-host/settings-page-host.component.js +2 -1
  12. package/app/components/settings-page-host/settings-page-host.component.js.map +1 -1
  13. package/app/components/shortcuts/shortcuts.component.d.ts +1 -0
  14. package/app/components/shortcuts/shortcuts.component.js +7 -3
  15. package/app/components/shortcuts/shortcuts.component.js.map +1 -1
  16. package/app/components/tab-content/tab-content.component.d.ts +2 -0
  17. package/app/components/tab-content/tab-content.component.js +8 -3
  18. package/app/components/tab-content/tab-content.component.js.map +1 -1
  19. package/app/exceptions/file-not-opened.exception.d.ts +26 -0
  20. package/app/exceptions/file-not-shown.exception.d.ts +27 -0
  21. package/app/exceptions/runtime-request.exception.d.ts +40 -0
  22. package/app/interfaces/i-document-options.d.ts +11 -0
  23. package/app/interfaces/i-opened-web-view.d.ts +2 -1
  24. package/app/interfaces/i-web-view-handle.d.ts +4 -2
  25. package/app/interfaces/i-window-part-context.d.ts +121 -15
  26. package/app/interfaces/i-window-part-host.d.ts +6 -1
  27. package/app/interfaces/i-window-part.d.ts +4 -1
  28. package/app/models/clipboard-image.js +26 -27
  29. package/app/models/clipboard-image.js.map +1 -1
  30. package/app/models/layout/early-document.d.ts +2 -1
  31. package/app/models/layout/early-document.js +3 -1
  32. package/app/models/layout/early-document.js.map +1 -1
  33. package/app/models/layout/layout.d.ts +1 -1
  34. package/app/models/layout/layout.js +9 -3
  35. package/app/models/layout/layout.js.map +1 -1
  36. package/app/models/layout/tab-group.d.ts +1 -0
  37. package/app/models/layout/tab-group.js +7 -0
  38. package/app/models/layout/tab-group.js.map +1 -1
  39. package/app/models/pending-document.d.ts +2 -1
  40. package/app/models/pending-document.js +5 -3
  41. package/app/models/pending-document.js.map +1 -1
  42. package/app/models/region-stop.d.ts +13 -0
  43. package/app/models/region-stop.js +19 -0
  44. package/app/models/region-stop.js.map +1 -0
  45. package/app/models/search-answer.d.ts +16 -1
  46. package/app/models/search-answer.js +3 -1
  47. package/app/models/search-answer.js.map +1 -1
  48. package/app/models/search-filter.d.ts +2 -1
  49. package/app/models/search-filter.js +3 -1
  50. package/app/models/search-filter.js.map +1 -1
  51. package/app/models/search-session.js +5 -2
  52. package/app/models/search-session.js.map +1 -1
  53. package/app/models/settings/shortcut-row.d.ts +2 -1
  54. package/app/models/settings/shortcut-row.js +3 -1
  55. package/app/models/settings/shortcut-row.js.map +1 -1
  56. package/app/models/view-place.d.ts +17 -0
  57. package/app/models/view-place.js +26 -0
  58. package/app/models/view-place.js.map +1 -0
  59. package/app/models/web-view-handle.d.ts +1 -0
  60. package/app/models/web-view-handle.js +1 -0
  61. package/app/models/web-view-handle.js.map +1 -1
  62. package/app/models/window-part-context.d.ts +5 -0
  63. package/app/models/window-part-context.js +35 -1
  64. package/app/models/window-part-context.js.map +1 -1
  65. package/app/models/window-part-source.d.ts +9 -1
  66. package/app/models/window-part-source.js +3 -1
  67. package/app/models/window-part-source.js.map +1 -1
  68. package/app/models/window-part-tokens.d.ts +13 -0
  69. package/app/models/window-part-tokens.js +1 -0
  70. package/app/models/window-part-tokens.js.map +1 -1
  71. package/app/services/document-history.service.d.ts +13 -0
  72. package/app/services/document-history.service.js +72 -14
  73. package/app/services/document-history.service.js.map +1 -1
  74. package/app/services/document-opener.service.d.ts +1 -1
  75. package/app/services/document-opener.service.js +2 -2
  76. package/app/services/document-opener.service.js.map +1 -1
  77. package/app/services/layout.reader.d.ts +4 -2
  78. package/app/services/layout.reader.js +26 -6
  79. package/app/services/layout.reader.js.map +1 -1
  80. package/app/services/layout.service.d.ts +2 -1
  81. package/app/services/layout.service.js +9 -6
  82. package/app/services/layout.service.js.map +1 -1
  83. package/app/services/live-view.service.d.ts +3 -0
  84. package/app/services/live-view.service.js +27 -0
  85. package/app/services/live-view.service.js.map +1 -1
  86. package/app/services/menu.service.js +1 -1
  87. package/app/services/menu.service.js.map +1 -1
  88. package/app/services/pane-keys.service.d.ts +19 -0
  89. package/app/services/pane-keys.service.js +29 -0
  90. package/app/services/pane-keys.service.js.map +1 -0
  91. package/app/services/preload-bridge.service.d.ts +1 -1
  92. package/app/services/preload-bridge.service.js +3 -2
  93. package/app/services/preload-bridge.service.js.map +1 -1
  94. package/app/services/region-focus.service.d.ts +12 -0
  95. package/app/services/region-focus.service.js +51 -0
  96. package/app/services/region-focus.service.js.map +1 -0
  97. package/app/services/shell-commands.service.d.ts +1 -0
  98. package/app/services/shell-commands.service.js +5 -1
  99. package/app/services/shell-commands.service.js.map +1 -1
  100. package/app/services/view-dialog.service.d.ts +2 -0
  101. package/app/services/view-dialog.service.js +14 -2
  102. package/app/services/view-dialog.service.js.map +1 -1
  103. package/app/services/web-view.service.d.ts +3 -0
  104. package/app/services/web-view.service.js +26 -2
  105. package/app/services/web-view.service.js.map +1 -1
  106. package/app/services/window-part-host.service.d.ts +6 -1
  107. package/app/services/window-part-host.service.js +28 -11
  108. package/app/services/window-part-host.service.js.map +1 -1
  109. package/package.json +3 -3
  110. package/resources.d.ts +58 -0
  111. package/resources.js +60 -0
  112. package/resources.js.map +1 -1
  113. package/testing/models/fake-window-part-context.d.ts +103 -0
  114. package/testing/models/fake-window-part-context.js +8 -0
  115. package/testing/models/fake-window-part-context.js.map +1 -1
  116. package/app/models/clipboard-image.resources.d.ts +0 -43
  117. package/app/models/clipboard-image.resources.js +0 -44
  118. package/app/models/clipboard-image.resources.js.map +0 -1
@@ -6,8 +6,35 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  import { WindowException } from "./window.exception.js";
9
+ /**
10
+ * The exception {@link IWindowPartContext.showInFolderAsync} rejects with when
11
+ * the window refuses to show a file in its folder, such as a path no file can
12
+ * be read at, or a network or device path, so a part tells that refusal apart
13
+ * from other failures.
14
+ */
9
15
  export declare class FileNotShownException extends WindowException {
16
+ /**
17
+ * The exception's name, `FileNotShownException`.
18
+ */
10
19
  readonly name: string;
20
+ /**
21
+ * Why the file wasn't shown, as the main process gave it, such as that no
22
+ * file can be read at the path.
23
+ */
11
24
  readonly reason: string;
25
+ /**
26
+ * Creates the exception, for the window to throw.
27
+ *
28
+ * @param productName The app's name, which the message starts with.
29
+ * @param reason Why the file wasn't shown.
30
+ * @example
31
+ * ```ts
32
+ * import { FileNotShownException } from "@noldova/desktop.window";
33
+ *
34
+ * export function readRefusal(error: unknown): string | null {
35
+ * return error instanceof FileNotShownException ? error.reason : null;
36
+ * }
37
+ * ```
38
+ */
12
39
  constructor(productName: string, reason: string);
13
40
  }
@@ -7,9 +7,49 @@
7
7
  */
8
8
  import type { JsonObject } from "@noldova/context.json";
9
9
  import { WindowException } from "./window.exception.js";
10
+ /**
11
+ * The exception {@link IWindowPartContext.requestAsync} rejects with when the
12
+ * runtime refuses or fails the request, so a part reads the failure's code and
13
+ * the details its module's runtime part gave, such as which note was missing.
14
+ */
10
15
  export declare class RuntimeRequestException extends WindowException {
16
+ /**
17
+ * The exception's name: `RuntimeRequestException`, or
18
+ * `RuntimeDisconnectedException` once the runtime is gone, when the window
19
+ * throws its own subclass; `instanceof RuntimeRequestException` holds for both.
20
+ */
11
21
  readonly name: string;
22
+ /**
23
+ * The failure's code, one of `FailureCode`'s values from
24
+ * `@noldova/desktop.protocol`: the one the runtime part's method failed with,
25
+ * such as `NotFound`, or `Disconnected` once the runtime is gone.
26
+ */
12
27
  readonly code: string;
28
+ /**
29
+ * The failure's details, as the runtime part's method gave them with its
30
+ * failure, or `undefined` when it gave none.
31
+ */
13
32
  readonly details: JsonObject | undefined;
33
+ /**
34
+ * Creates the exception, for the window to throw, and for a part's specs to
35
+ * reject a fake request with, as the testing package's
36
+ * `FakeWindowPartContext.requestAsync` shows.
37
+ *
38
+ * @param code The failure's code.
39
+ * @param message A sentence describing the failure.
40
+ * @param details The failure's details, if any.
41
+ * @example
42
+ * ```ts
43
+ * import { JsonReader } from "@noldova/context.json";
44
+ * import { FailureCode } from "@noldova/desktop.protocol";
45
+ * import { RuntimeRequestException } from "@noldova/desktop.window";
46
+ *
47
+ * export function readMissingNote(error: unknown): string | null {
48
+ * if (!(error instanceof RuntimeRequestException) || error.code !== FailureCode.NotFound || error.details === undefined)
49
+ * return null;
50
+ * return JsonReader.fromValue(error.details).readString("path");
51
+ * }
52
+ * ```
53
+ */
14
54
  constructor(code: string, message: string, details?: JsonObject);
15
55
  }
@@ -76,4 +76,15 @@ export interface IDocumentOptions {
76
76
  * is only activated where it is.
77
77
  */
78
78
  readonly after?: string;
79
+ /**
80
+ * Whether the document becomes its group's active tab, as when the person
81
+ * chooses it; true when left out. When false, the document joins its group's
82
+ * tabs without becoming active, the group stays as it was, and the focus
83
+ * stays where it is, such as a page an agent opens beside the one the person
84
+ * reads; an open document stays where it is, behind the active tab. A preview
85
+ * replaces the group's preview only when that preview isn't the active tab,
86
+ * which otherwise stays open as an ordinary tab. A document opened into an
87
+ * empty group still becomes that group's active tab.
88
+ */
89
+ readonly activate?: boolean;
79
90
  }
@@ -5,8 +5,9 @@
5
5
  * This source code is licensed under the license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- import type { WebViewInfo } from "@noldova/desktop.protocol";
8
+ import type { KeyChord, WebViewInfo } from "@noldova/desktop.protocol";
9
9
  export interface IOpenedWebView {
10
10
  readonly view: WebViewInfo;
11
11
  readonly partition: string;
12
+ readonly keys: readonly KeyChord[];
12
13
  }
@@ -335,8 +335,10 @@ export interface IWebViewHandle {
335
335
  /**
336
336
  * Reports the view's events: its state, failed loads, refused navigations
337
337
  * and requests, a crash, a cleared profile, the person's declared keys, each
338
- * zoom change and each search's result, and `Closed` when the main
339
- * process ends it. No event comes after the part closes the view itself.
338
+ * zoom change, each search's result, each change of the page's icon as a
339
+ * `Favicon` event whose `image` is a `data:image/png` URL or null, and
340
+ * `Closed` when the main process ends it. No event comes after the part
341
+ * closes the view itself.
340
342
  *
341
343
  * @param listener Receives each event.
342
344
  * @returns The release.
@@ -648,15 +648,16 @@ export interface IWindowPartContext {
648
648
  /**
649
649
  * Opens one of the module's documents at the end of the active document
650
650
  * group, or right after another of its open instances when
651
- * {@link IDocumentOptions.after} names one, or activates it where it is. While the part first activates with a saved
651
+ * {@link IDocumentOptions.after} names one, or activates it where it is,
652
+ * unless {@link IDocumentOptions.activate} is false. While the part first activates with a saved
652
653
  * layout, the document shows only when the layout holds it. An open document
653
654
  * keeps its look, changing only what the options give.
654
655
  *
655
656
  * @param name The document's name.
656
657
  * @param instance Which of the document's instances, such as a note's id.
657
658
  * @param title The tab's title.
658
- * @param options Whether it opens as a preview, its breadcrumb, its look
659
- * and the document it opens after; an ordinary tab with no breadcrumb, at
659
+ * @param options Whether it opens as a preview, its breadcrumb, its look,
660
+ * the document it opens after and whether it becomes active; an ordinary, active tab with no breadcrumb, at
660
661
  * the end of the active group, when left out.
661
662
  * @throws Error synchronously when the document belongs to another module,
662
663
  * or the title or a breadcrumb segment is blank.
@@ -910,6 +911,34 @@ export interface IWindowPartContext {
910
911
  * ```
911
912
  */
912
913
  closeView(name: string, instance: string): void;
914
+ /**
915
+ * Closes the view dialog while it shows one of the module's views or
916
+ * documents, with instances or without, such as after an action of the view
917
+ * leads elsewhere: the dialog closes as when the person closes it, its view
918
+ * returns to its tab if it came from one, and the focus returns where the
919
+ * person's close returns it, or goes to the tab of a document the module
920
+ * opened or activated since the dialog showed, as in the example below.
921
+ * Nothing happens while the view or document
922
+ * shows in a tab, or the dialog shows something else or nothing, so a view
923
+ * never needs to know whether it shows in a dialog: it asks to close the
924
+ * dialog either way.
925
+ *
926
+ * @param name The view's or document's name.
927
+ * @param instance The instance the dialog must show for it to close; any
928
+ * instance of the name when omitted.
929
+ * @throws Error synchronously when the name belongs to another module or is
930
+ * not one of the module's views or documents, or the instance is blank.
931
+ * @example
932
+ * ```ts
933
+ * import type { IWindowPartContext } from "@noldova/desktop.window";
934
+ *
935
+ * export function startChat(context: IWindowPartContext, person: string): void {
936
+ * context.openDocument("chat.conversation", person, person);
937
+ * context.closeDialog("chat.people");
938
+ * }
939
+ * ```
940
+ */
941
+ closeDialog(name: string, instance?: string): void;
913
942
  /**
914
943
  * Shows one of the part's views without instances, such as a bottom
915
944
  * panel, and moves the focus into it, as choosing its tab with the
@@ -1059,6 +1088,75 @@ export interface IWindowPartContext {
1059
1088
  * ```
1060
1089
  */
1061
1090
  onViewClosed(name: string, listener: (instance: string) => void): () => void;
1091
+ /**
1092
+ * Adds a place the view shows, such as a list's item or a pane's page, to
1093
+ * Back and Forward, after the entry the person is on: the same history as
1094
+ * the documents shown in the middle, whose entries ahead it drops and whose
1095
+ * 50-entry limit it shares. A place equal to the entry the person is on is
1096
+ * ignored, so a view can record each place it shows, including one it shows
1097
+ * because Back or Forward reached it. While the part is inactive, the call
1098
+ * does nothing.
1099
+ *
1100
+ * @param view The view's name, the module's.
1101
+ * @param place The place, a string the module chooses that is not blank,
1102
+ * such as an item's id or a page's address; the same view, instance and
1103
+ * place make the same place.
1104
+ * @param instance The view's instance, given for a view with instances and
1105
+ * left out for one without.
1106
+ * @throws Error synchronously when the view belongs to another module, is
1107
+ * not a registered view, gets an instance it doesn't have or lacks one it
1108
+ * has, or the place or instance is blank.
1109
+ * @example
1110
+ * ```ts
1111
+ * import type { IWindowPartContext } from "@noldova/desktop.window";
1112
+ *
1113
+ * export function showNote(context: IWindowPartContext, id: string): void {
1114
+ * context.recordPlace("notes.list", id);
1115
+ * }
1116
+ * ```
1117
+ */
1118
+ recordPlace(view: string, place: string, instance?: string): void;
1119
+ /**
1120
+ * Takes a place the module no longer has out of Back and Forward, such as
1121
+ * a deleted item. While the part is inactive, the call does nothing; the
1122
+ * window drops a module's places when its part deactivates.
1123
+ *
1124
+ * @param view The view's name, the module's.
1125
+ * @param place The place, as {@link recordPlace} gave it.
1126
+ * @param instance The view's instance, as {@link recordPlace} gave it.
1127
+ * @throws Error synchronously as {@link recordPlace} does.
1128
+ * @example
1129
+ * ```ts
1130
+ * import type { IWindowPartContext } from "@noldova/desktop.window";
1131
+ *
1132
+ * export function deleteNote(context: IWindowPartContext, id: string): void {
1133
+ * context.forgetPlace("notes.list", id);
1134
+ * }
1135
+ * ```
1136
+ */
1137
+ forgetPlace(view: string, place: string, instance?: string): void;
1138
+ /**
1139
+ * Listens for Back or Forward reaching one of the view's places. The window
1140
+ * shows the view first, the instance's tab or the view in its dock, and
1141
+ * then calls each listener with the place to show. Back and Forward skip a
1142
+ * place whose view has no listener or whose instance's tab is closed.
1143
+ *
1144
+ * @param view The view's name, the module's.
1145
+ * @param listener Called with the place and the instance it was recorded
1146
+ * for, or null for a view without instances.
1147
+ * @returns A function that removes the listener.
1148
+ * @throws Error synchronously when the view belongs to another module or
1149
+ * is not a registered view.
1150
+ * @example
1151
+ * ```ts
1152
+ * import type { IWindowPartContext } from "@noldova/desktop.window";
1153
+ *
1154
+ * export function followHistory(context: IWindowPartContext, show: (id: string) => void): () => void {
1155
+ * return context.onPlaceShown("notes.list", show);
1156
+ * }
1157
+ * ```
1158
+ */
1159
+ onPlaceShown(view: string, listener: (place: string, instance: string | null) => void): () => void;
1062
1160
  /**
1063
1161
  * Shows a view or document in a large modal dialog. One already open in a
1064
1162
  * tab moves into the dialog and returns when it closes.
@@ -1082,8 +1180,8 @@ export interface IWindowPartContext {
1082
1180
  /**
1083
1181
  * Opens a palette just under the window row, centred across the window, as
1084
1182
  * the command search opens: the part's component, created with its
1085
- * {@link WindowPartTokens}, with `shown` true and a content padding of its
1086
- * own. The window shows one palette at a time.
1183
+ * {@link WindowPartTokens}, with `shown` true, `activeDocument` false and a
1184
+ * content padding of its own. The window shows one palette at a time.
1087
1185
  *
1088
1186
  * @param load Loads the palette's component.
1089
1187
  * @returns The palette, or null when the window shows no window row,
@@ -1221,9 +1319,9 @@ export interface IWindowPartContext {
1221
1319
  *
1222
1320
  * @param path The file's or folder's absolute path.
1223
1321
  * @returns A promise that settles once the request is handed to the system's
1224
- * file manager; it rejects, with the reason, when the path is refused.
1225
- * After the part is withdrawn, it settles at once without checking the path
1226
- * and shows nothing.
1322
+ * file manager; it rejects with a {@link FileNotShownException}, whose
1323
+ * `reason` says why, when the path is refused. After the part is withdrawn,
1324
+ * it settles at once without checking the path and shows nothing.
1227
1325
  * @example
1228
1326
  * ```ts
1229
1327
  * import type { IWindowPartContext } from "@noldova/desktop.window";
@@ -1256,15 +1354,22 @@ export interface IWindowPartContext {
1256
1354
  *
1257
1355
  * @param path The file's absolute path.
1258
1356
  * @returns A promise that settles once the system has taken the file; it
1259
- * rejects, with the reason, when the file is refused or the system cannot
1260
- * open it. After the part is withdrawn, it settles at once without checking
1261
- * the path and opens nothing.
1357
+ * rejects with a {@link FileNotOpenedException}, whose `reason` says why,
1358
+ * when the file is refused or the system cannot open it. After the part is
1359
+ * withdrawn, it settles at once without checking the path and opens nothing.
1262
1360
  * @example
1263
1361
  * ```ts
1264
- * import type { IWindowPartContext } from "@noldova/desktop.window";
1362
+ * import { FileNotOpenedException, type IWindowPartContext } from "@noldova/desktop.window";
1265
1363
  *
1266
1364
  * export async function openReportAsync(context: IWindowPartContext, path: string): Promise<void> {
1267
- * await context.openFileAsync(path).catch(() => context.showInFolderAsync(path));
1365
+ * try {
1366
+ * await context.openFileAsync(path);
1367
+ * }
1368
+ * catch (error) {
1369
+ * if (!(error instanceof FileNotOpenedException))
1370
+ * throw error;
1371
+ * await context.showInFolderAsync(path);
1372
+ * }
1268
1373
  * }
1269
1374
  * ```
1270
1375
  */
@@ -1461,8 +1566,9 @@ export interface IWindowPartContext {
1461
1566
  * @param method The method's name.
1462
1567
  * @param parameters The parameters.
1463
1568
  * @returns A promise of the method's result; it rejects when the method
1464
- * belongs to neither the module nor a dependency, or the runtime refuses
1465
- * or fails the request.
1569
+ * belongs to neither the module nor a dependency, and with a
1570
+ * {@link RuntimeRequestException}, whose `code` and `details` say why, when
1571
+ * the runtime refuses or fails the request.
1466
1572
  * @example
1467
1573
  * ```ts
1468
1574
  * import type { JsonValue } from "@noldova/context.json";
@@ -15,6 +15,7 @@ import type { IssuedFileGrants } from "../models/issued-file-grants.js";
15
15
  import type { Tab } from "../models/layout/tab.js";
16
16
  import type { MenuItem } from "../models/menu-item.js";
17
17
  import type { ViewBadge } from "../models/view-badge.js";
18
+ import type { ViewPlace } from "../models/view-place.js";
18
19
  import type { ICommandKey } from "./i-command-key.js";
19
20
  import type { IDocumentUpdate } from "./i-document-update.js";
20
21
  import type { IInAppBrowser } from "./i-in-app-browser.js";
@@ -31,7 +32,7 @@ export interface IWindowPartHost {
31
32
  readonly platform: string;
32
33
  requestAsync(method: string, payload: JsonValue): Promise<JsonValue>;
33
34
  onEvent(name: string, listener: (payload: JsonValue) => void): () => void;
34
- openDocument(moduleId: string, name: string, instance: string, heading: DocumentHeading, isPreview: boolean, after: string | null): void;
35
+ openDocument(moduleId: string, name: string, instance: string, heading: DocumentHeading, isPreview: boolean, after: string | null, activate: boolean): void;
35
36
  keepDocument(moduleId: string, name: string, instance: string): void;
36
37
  closeDocument(moduleId: string, name: string, instance: string): void;
37
38
  forgetDocument(moduleId: string, name: string, instance: string): void;
@@ -44,11 +45,15 @@ export interface IWindowPartHost {
44
45
  openView(moduleId: string, name: string, instance: string, heading: DocumentHeading, icon: string | null, tabGroup: string | null): void;
45
46
  updateView(moduleId: string, name: string, instance: string, title: string | null, icon: string | null, breadcrumb: readonly string[] | null, breadcrumbIcon: string | null): void;
46
47
  closeView(moduleId: string, name: string, instance: string): void;
48
+ closeDialog(name: string, instance: string | null): void;
47
49
  showView(moduleId: string, name: string): void;
48
50
  hideViewDock(moduleId: string, name: string, instance: string | null): void;
49
51
  growViewDock(name: string, instance: string | null, minimum: number): () => void;
50
52
  viewDockOf(name: string, instance: string | null): Signal<DockSide | null>;
51
53
  onViewClosed(name: string, listener: (instance: string) => void): () => void;
54
+ recordPlace(place: ViewPlace): void;
55
+ forgetPlace(place: ViewPlace): void;
56
+ onPlaceShown(view: string, listener: (place: string, instance: string | null) => void): () => void;
52
57
  showInDialogAsync(name: string, instance: string | null, title: string | null): Promise<void>;
53
58
  openBelowWindowRow<T>(context: IWindowPartContext, component: Type<T>): IWindowPalette<T> | null;
54
59
  log(moduleId: string, message: string): void;
@@ -87,7 +87,10 @@ export interface IWindowPart {
87
87
  * with its context, contributions, views and documents. Before resolving
88
88
  * true, the part reads again through its context everything it took from
89
89
  * the runtime, including its notifications, because the new runtime may
90
- * hold other state and events sent while it was away are lost.
90
+ * hold other state and events sent while it was away are lost. A document
91
+ * the part opens from here, or from anything else it runs while the window
92
+ * reconnects, waits for the reconnect to end, then opens as at any other
93
+ * time, in the order asked, each in front, so the last one is active.
91
94
  *
92
95
  * @returns A promise of true when the part continues, or false to have the
93
96
  * window deactivate it and activate it again, which is always safe; a
@@ -6,7 +6,6 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  import { Resources } from "../../resources.js";
9
- import { ClipboardImageResources } from "./clipboard-image.resources.js";
10
9
  export class ClipboardImage {
11
10
  static async readAsync(bytes) {
12
11
  if (bytes.byteLength > Resources.imageCopyByteLimit)
@@ -44,8 +43,8 @@ export class ClipboardImage {
44
43
  }
45
44
  static sizeOf(bytes) {
46
45
  if (ClipboardImage.matches(bytes, 0, Resources.pngSignature))
47
- return ClipboardImage.matches(bytes, ClipboardImageResources.pngHeaderChunkOffset, Resources.pngHeaderChunk) && bytes.byteLength > ClipboardImageResources.pngHeaderLength
48
- ? [ClipboardImage.readUint32(bytes, ClipboardImageResources.pngWidthOffset), ClipboardImage.readUint32(bytes, ClipboardImageResources.pngHeightOffset)] : null;
46
+ return ClipboardImage.matches(bytes, Resources.pngHeaderChunkOffset, Resources.pngHeaderChunk) && bytes.byteLength > Resources.pngHeaderLength
47
+ ? [ClipboardImage.readUint32(bytes, Resources.pngWidthOffset), ClipboardImage.readUint32(bytes, Resources.pngHeightOffset)] : null;
49
48
  if (ClipboardImage.matches(bytes, 0, Resources.jpegSignature))
50
49
  return ClipboardImage.jpegSizeOf(bytes);
51
50
  if (Resources.gifSignatures.some(t => ClipboardImage.matches(bytes, 0, t)))
@@ -55,55 +54,55 @@ export class ClipboardImage {
55
54
  return null;
56
55
  }
57
56
  static jpegSizeOf(bytes) {
58
- let offset = ClipboardImageResources.jpegFirstMarkerOffset;
59
- while (offset + ClipboardImageResources.jpegMarkerLookahead < bytes.byteLength && bytes[offset] === ClipboardImageResources.jpegMarkerPrefix) {
57
+ let offset = Resources.jpegFirstMarkerOffset;
58
+ while (offset + Resources.jpegMarkerLookahead < bytes.byteLength && bytes[offset] === Resources.jpegMarkerPrefix) {
60
59
  const marker = ClipboardImage.view(bytes).getUint8(offset + 1);
61
- if (marker === ClipboardImageResources.jpegMarkerPrefix)
60
+ if (marker === Resources.jpegMarkerPrefix)
62
61
  offset += 1;
63
62
  else if (Resources.jpegEndMarkers.includes(marker))
64
63
  return null;
65
64
  else if (Resources.jpegStandaloneMarkers.includes(marker))
66
- offset += ClipboardImageResources.jpegMarkerLength;
65
+ offset += Resources.jpegMarkerLength;
67
66
  else if (Resources.jpegFrameMarkers.includes(marker))
68
- return offset + ClipboardImageResources.jpegFrameLength <= bytes.byteLength
69
- ? [ClipboardImage.readUint16(bytes, offset + ClipboardImageResources.jpegFrameWidthOffset), ClipboardImage.readUint16(bytes, offset + ClipboardImageResources.jpegFrameHeightOffset)]
67
+ return offset + Resources.jpegFrameLength <= bytes.byteLength
68
+ ? [ClipboardImage.readUint16(bytes, offset + Resources.jpegFrameWidthOffset), ClipboardImage.readUint16(bytes, offset + Resources.jpegFrameHeightOffset)]
70
69
  : null;
71
70
  else
72
- offset += ClipboardImageResources.jpegMarkerLength + ClipboardImage.readUint16(bytes, offset + ClipboardImageResources.jpegMarkerLength);
71
+ offset += Resources.jpegMarkerLength + ClipboardImage.readUint16(bytes, offset + Resources.jpegMarkerLength);
73
72
  }
74
73
  return null;
75
74
  }
76
75
  static gifSizeOf(bytes) {
77
- if (bytes.byteLength <= ClipboardImageResources.gifHeaderLength)
76
+ if (bytes.byteLength <= Resources.gifHeaderLength)
78
77
  return null;
79
78
  const view = ClipboardImage.view(bytes);
80
- const screen = view.getUint8(ClipboardImageResources.gifFlagsOffset);
81
- let offset = ClipboardImageResources.gifHeaderLength
82
- + ((screen & Resources.gifColorTableFlag) === 0 ? 0 : ClipboardImageResources.gifColorEntryBytes * 2 ** ((screen & ClipboardImageResources.gifColorTableSizeMask) + 1));
79
+ const screen = view.getUint8(Resources.gifFlagsOffset);
80
+ let offset = Resources.gifHeaderLength
81
+ + ((screen & Resources.gifColorTableFlag) === 0 ? 0 : Resources.gifColorEntryBytes * 2 ** ((screen & Resources.gifColorTableSizeMask) + 1));
83
82
  while (offset + 1 < bytes.byteLength && view.getUint8(offset) === Resources.gifExtensionIntroducer) {
84
- offset += ClipboardImageResources.gifExtensionHeaderLength;
83
+ offset += Resources.gifExtensionHeaderLength;
85
84
  while (offset < bytes.byteLength && view.getUint8(offset) !== 0)
86
85
  offset += view.getUint8(offset) + 1;
87
86
  offset += 1;
88
87
  }
89
- if (offset + ClipboardImageResources.gifDescriptorLength > bytes.byteLength || view.getUint8(offset) !== Resources.gifImageSeparator)
88
+ if (offset + Resources.gifDescriptorLength > bytes.byteLength || view.getUint8(offset) !== Resources.gifImageSeparator)
90
89
  return null;
91
90
  return [
92
- Math.max(ClipboardImage.readUint16Le(bytes, ClipboardImageResources.gifScreenWidthOffset), ClipboardImage.readUint16Le(bytes, offset + ClipboardImageResources.gifLeftOffset) + ClipboardImage.readUint16Le(bytes, offset + ClipboardImageResources.gifWidthOffset)),
93
- Math.max(ClipboardImage.readUint16Le(bytes, ClipboardImageResources.gifScreenHeightOffset), ClipboardImage.readUint16Le(bytes, offset + ClipboardImageResources.gifTopOffset) + ClipboardImage.readUint16Le(bytes, offset + ClipboardImageResources.gifHeightOffset))
91
+ Math.max(ClipboardImage.readUint16Le(bytes, Resources.gifScreenWidthOffset), ClipboardImage.readUint16Le(bytes, offset + Resources.gifLeftOffset) + ClipboardImage.readUint16Le(bytes, offset + Resources.gifWidthOffset)),
92
+ Math.max(ClipboardImage.readUint16Le(bytes, Resources.gifScreenHeightOffset), ClipboardImage.readUint16Le(bytes, offset + Resources.gifTopOffset) + ClipboardImage.readUint16Le(bytes, offset + Resources.gifHeightOffset))
94
93
  ];
95
94
  }
96
95
  static webpSizeOf(bytes) {
97
- if (bytes.byteLength <= ClipboardImageResources.webpMinimumLength)
96
+ if (bytes.byteLength <= Resources.webpMinimumLength)
98
97
  return null;
99
- if (ClipboardImage.matches(bytes, ClipboardImageResources.webpChunkOffset, Resources.webpLossyChunk))
100
- return [ClipboardImage.readUint16Le(bytes, ClipboardImageResources.webpLossyWidthOffset) & ClipboardImageResources.webpDimensionMask, ClipboardImage.readUint16Le(bytes, ClipboardImageResources.webpLossyHeightOffset) & ClipboardImageResources.webpDimensionMask];
101
- if (ClipboardImage.matches(bytes, ClipboardImageResources.webpChunkOffset, Resources.webpLosslessChunk)) {
102
- const bits = ClipboardImage.readUint16Le(bytes, ClipboardImageResources.webpLosslessBitsOffset) + ClipboardImage.readUint16Le(bytes, ClipboardImageResources.webpLosslessHighOffset) * ClipboardImageResources.uint16Range;
103
- return [(bits & ClipboardImageResources.webpDimensionMask) + 1, Math.floor(bits / ClipboardImageResources.webpLosslessHeightDivisor) % ClipboardImageResources.webpLosslessHeightDivisor + 1];
98
+ if (ClipboardImage.matches(bytes, Resources.webpChunkOffset, Resources.webpLossyChunk))
99
+ return [ClipboardImage.readUint16Le(bytes, Resources.webpLossyWidthOffset) & Resources.webpDimensionMask, ClipboardImage.readUint16Le(bytes, Resources.webpLossyHeightOffset) & Resources.webpDimensionMask];
100
+ if (ClipboardImage.matches(bytes, Resources.webpChunkOffset, Resources.webpLosslessChunk)) {
101
+ const bits = ClipboardImage.readUint16Le(bytes, Resources.webpLosslessBitsOffset) + ClipboardImage.readUint16Le(bytes, Resources.webpLosslessHighOffset) * Resources.uint16Range;
102
+ return [(bits & Resources.webpDimensionMask) + 1, Math.floor(bits / Resources.webpLosslessHeightDivisor) % Resources.webpLosslessHeightDivisor + 1];
104
103
  }
105
- if (ClipboardImage.matches(bytes, ClipboardImageResources.webpChunkOffset, Resources.webpExtendedChunk))
106
- return [ClipboardImage.readUint24Le(bytes, ClipboardImageResources.webpExtendedWidthOffset) + 1, ClipboardImage.readUint24Le(bytes, ClipboardImageResources.webpExtendedHeightOffset) + 1];
104
+ if (ClipboardImage.matches(bytes, Resources.webpChunkOffset, Resources.webpExtendedChunk))
105
+ return [ClipboardImage.readUint24Le(bytes, Resources.webpExtendedWidthOffset) + 1, ClipboardImage.readUint24Le(bytes, Resources.webpExtendedHeightOffset) + 1];
107
106
  return null;
108
107
  }
109
108
  static readUint16(bytes, offset) {
@@ -116,7 +115,7 @@ export class ClipboardImage {
116
115
  return ClipboardImage.view(bytes).getUint16(offset, true);
117
116
  }
118
117
  static readUint24Le(bytes, offset) {
119
- return ClipboardImage.readUint16Le(bytes, offset) + ClipboardImage.view(bytes).getUint8(offset + 2) * ClipboardImageResources.uint16Range;
118
+ return ClipboardImage.readUint16Le(bytes, offset) + ClipboardImage.view(bytes).getUint8(offset + 2) * Resources.uint16Range;
120
119
  }
121
120
  static view(bytes) {
122
121
  return new DataView(bytes.buffer, bytes.byteOffset);
@@ -1 +1 @@
1
- {"version":3,"file":"clipboard-image.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.window/src/app/models/clipboard-image.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC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E,MAAc;QACzD,OAAO,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;IAEO,MAAM,CAAC,UAAU,CAAC,KAAiB,EAAE,MAAc;QACzD,OAAO,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,KAAiB,EAAE,MAAc;QAC3D,OAAO,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,KAAiB,EAAE,MAAc;QAC3D,OAAO,cAAc,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,WAAW,CAAC;IAC9H,CAAC;IAEO,MAAM,CAAC,IAAI,CAAC,KAAiB;QACnC,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACtD,CAAC;IAEO,MAAM,CAAC,OAAO,CAAC,KAAiB,EAAE,MAAc,EAAE,SAAqC;QAC7F,OAAO,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC,UAAU,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAChI,CAAC;CACF"}
@@ -10,5 +10,6 @@ export declare class EarlyDocument {
10
10
  readonly tab: DocumentTab;
11
11
  readonly isPreview: boolean;
12
12
  readonly after: DocumentTab | null;
13
- constructor(tab: DocumentTab, isPreview: boolean, after: DocumentTab | null);
13
+ readonly activates: boolean;
14
+ constructor(tab: DocumentTab, isPreview: boolean, after: DocumentTab | null, activates: boolean);
14
15
  }
@@ -9,10 +9,12 @@ export class EarlyDocument {
9
9
  tab;
10
10
  isPreview;
11
11
  after;
12
- constructor(tab, isPreview, after) {
12
+ activates;
13
+ constructor(tab, isPreview, after, activates) {
13
14
  this.tab = tab;
14
15
  this.isPreview = isPreview;
15
16
  this.after = after;
17
+ this.activates = activates;
16
18
  }
17
19
  }
18
20
  //# sourceMappingURL=early-document.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"early-document.js","sourceRoot":"","sources":["../../../../../../src/noldova.desktop.window/src/app/models/layout/early-document.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,OAAO,aAAa;IACR,GAAG,CAAc;IACjB,SAAS,CAAU;IACnB,KAAK,CAAqB;IAE1C,YAAmB,GAAgB,EAAE,SAAkB,EAAE,KAAyB;QAChF,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
1
+ {"version":3,"file":"early-document.js","sourceRoot":"","sources":["../../../../../../src/noldova.desktop.window/src/app/models/layout/early-document.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,OAAO,aAAa;IACR,GAAG,CAAc;IACjB,SAAS,CAAU;IACnB,KAAK,CAAqB;IAC1B,SAAS,CAAU;IAEnC,YAAmB,GAAgB,EAAE,SAAkB,EAAE,KAAyB,EAAE,SAAkB;QACpG,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF"}
@@ -37,7 +37,7 @@ export declare class Layout {
37
37
  sideOf(groupId: number): DockSide | null;
38
38
  isOpen(tab: Tab): boolean;
39
39
  openView(tab: ViewTab, registry: ViewRegistry): Layout;
40
- openDocument(tab: DocumentTab, isPreview?: boolean, after?: DocumentTab | null): Layout;
40
+ openDocument(tab: DocumentTab, isPreview?: boolean, after?: DocumentTab | null, activate?: boolean): Layout;
41
41
  restoreDocument(tab: DocumentTab, isPreview: boolean): Layout;
42
42
  keepPreviews(): Layout;
43
43
  focusDocuments(groupId: number): Layout;
@@ -92,10 +92,16 @@ export class Layout {
92
92
  const opened = Object.isNull(root) ? new TabGroup(this.nextId, [tab], tab) : root.withGroup(root.cornerGroup.insert(tab, root.cornerGroup.tabs.length));
93
93
  return this.withDock(dock.withRoot(opened).withCollapsed(false));
94
94
  }
95
- openDocument(tab, isPreview = false, after = null) {
96
- if (this.isOpen(tab))
97
- return isPreview ? this.activate(tab) : this.activate(tab).keep(tab);
95
+ openDocument(tab, isPreview = false, after = null, activate = true) {
96
+ if (this.isOpen(tab)) {
97
+ const shown = activate ? this.activate(tab) : this;
98
+ return isPreview ? shown : shown.keep(tab);
99
+ }
98
100
  const group = Object.isNull(after) ? null : this.groupOf(after);
101
+ if (!activate) {
102
+ const target = group ?? this.documents;
103
+ return this.withGroup(target.add(tab, Object.isNull(group) ? target.tabs.length : target.tabs.findIndex(t => t.equals(after)) + 1, isPreview));
104
+ }
99
105
  if (Object.isNull(group))
100
106
  return this.withGroup(isPreview ? this.documents.openPreview(tab) : this.documents.insert(tab, this.documents.tabs.length));
101
107
  const index = group.tabs.findIndex(t => t.equals(after)) + 1;