@septkit/shell-lib 0.0.43 → 0.0.45

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/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export type * from './types';
2
2
  export { SHELL_DB_PREFIX, LIBRARY_DB_PREFIX, TEMP_DOCUMENT_PREFIX, TEMP_PROJECT_PREFIX, RESERVED_DB_PREFIXES, isReservedDatabaseName, } from './constants';
3
- export { setShellContext, clearShellContext, getProject, getActiveDocumentId, getCommands, getStorageSources, getPwa, getProjectStorage, getTasks, } from './shell-context';
3
+ export { setShellContext, clearShellContext, getProject, getActiveDocumentId, getCommands, getStorageSources, getPwa, getProjectStorage, getTasks, getClipboard, } from './shell-context';
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ function a(e) {
9
9
  return i.some((t) => e.startsWith(t));
10
10
  }
11
11
  //#endregion
12
- //#region node_modules/.pnpm/@dialecte+core@0.14.0/node_modules/@dialecte/core/dist/utils-9L5_yIvs.js
12
+ //#region node_modules/.pnpm/@dialecte+core@0.17.1/node_modules/@dialecte/core/dist/utils--Sb33WPa.js
13
13
  var o = "https://dialecte.github.io/core", s = /* @__PURE__ */ new Set([
14
14
  "throwDialecteError",
15
15
  "createDialecteError",
@@ -582,6 +582,15 @@ var o = "https://dialecte.github.io/core", s = /* @__PURE__ */ new Set([
582
582
  fix: "Choose a path no other document holds, or move the other document first.",
583
583
  docs: `${o}/api/project#a-document-s-path`
584
584
  }
585
+ },
586
+ SAVE_TARGET_DISCARDED: {
587
+ code: "D7032",
588
+ message: "The save target was discarded",
589
+ explanation: {
590
+ when: "A file was written to a save target after its `discard()`: the chosen file may be removed already, so nothing is written.",
591
+ fix: "Open a new target with `openSaveTarget` at the user's next click, or write before discarding.",
592
+ docs: `${o}/guide/development/utils#opensavetarget`
593
+ }
585
594
  }
586
595
  };
587
596
  new Set(Object.values(c).map((e) => e.code));
@@ -1349,5 +1358,31 @@ var te = { begin: function() {
1349
1358
  fail: function() {}
1350
1359
  };
1351
1360
  } };
1361
+ function ne() {
1362
+ return G?.clipboard ?? re;
1363
+ }
1364
+ var re = ie();
1365
+ function ie() {
1366
+ let e, t = [];
1367
+ function n(n) {
1368
+ let r = e;
1369
+ e = n;
1370
+ for (let n of t) n(e, r);
1371
+ }
1372
+ return {
1373
+ entry: {
1374
+ get value() {
1375
+ return e;
1376
+ },
1377
+ subscribe(e) {
1378
+ return t.push(e), () => {
1379
+ t = t.filter((t) => t !== e);
1380
+ };
1381
+ }
1382
+ },
1383
+ set: (e) => n(e),
1384
+ clear: () => n(void 0)
1385
+ };
1386
+ }
1352
1387
  //#endregion
1353
- export { t as LIBRARY_DB_PREFIX, i as RESERVED_DB_PREFIXES, e as SHELL_DB_PREFIX, n as TEMP_DOCUMENT_PREFIX, r as TEMP_PROJECT_PREFIX, q as clearShellContext, Y as getActiveDocumentId, X as getCommands, J as getProject, $ as getProjectStorage, Q as getPwa, Z as getStorageSources, ee as getTasks, a as isReservedDatabaseName, K as setShellContext };
1388
+ export { t as LIBRARY_DB_PREFIX, i as RESERVED_DB_PREFIXES, e as SHELL_DB_PREFIX, n as TEMP_DOCUMENT_PREFIX, r as TEMP_PROJECT_PREFIX, q as clearShellContext, Y as getActiveDocumentId, ne as getClipboard, X as getCommands, J as getProject, $ as getProjectStorage, Q as getPwa, Z as getStorageSources, ee as getTasks, a as isReservedDatabaseName, K as setShellContext };
@@ -1,6 +1,7 @@
1
1
  import { Scl } from '@dialecte/scl/v2019C1';
2
2
  import { Observable, ShellCommands } from './types/api';
3
3
  import { BackgroundTasks } from './types/background-tasks';
4
+ import { ShellClipboard } from './types/clipboard';
4
5
  import { ProjectStorage } from './types/project-storage';
5
6
  import { PwaInstall } from './types/pwa-install';
6
7
  import { StorageSources } from './types/storage-source';
@@ -12,6 +13,7 @@ interface ShellContext {
12
13
  pwa?: PwaInstall;
13
14
  projectStorage?: ProjectStorage;
14
15
  tasks?: BackgroundTasks;
16
+ clipboard?: ShellClipboard;
15
17
  }
16
18
  export declare function setShellContext(ctx: ShellContext): void;
17
19
  export declare function clearShellContext(): void;
@@ -22,4 +24,5 @@ export declare function getStorageSources(): StorageSources;
22
24
  export declare function getPwa(): PwaInstall;
23
25
  export declare function getProjectStorage(): ProjectStorage;
24
26
  export declare function getTasks(): BackgroundTasks;
27
+ export declare function getClipboard(): ShellClipboard;
25
28
  export {};
@@ -1,5 +1,6 @@
1
1
  import { Scl } from '@dialecte/scl/v2019C1';
2
2
  import { BackgroundTasks } from './background-tasks';
3
+ import { ShellClipboard } from './clipboard';
3
4
  import { ProjectStorage } from './project-storage';
4
5
  import { PwaInstall } from './pwa-install';
5
6
  import { StorageSources } from './storage-source';
@@ -21,4 +22,5 @@ export interface ExtensionAPI {
21
22
  pwa?: PwaInstall;
22
23
  projectStorage?: ProjectStorage;
23
24
  tasks?: BackgroundTasks;
25
+ clipboard?: ShellClipboard;
24
26
  }
@@ -0,0 +1,14 @@
1
+ import { Observable } from './api';
2
+ export type ClipboardEntry = {
3
+ documentId: string;
4
+ ref: {
5
+ tagName: string;
6
+ id: string;
7
+ };
8
+ verb: 'copy' | 'cut';
9
+ };
10
+ export interface ShellClipboard {
11
+ entry: Observable<ClipboardEntry>;
12
+ set(entry: ClipboardEntry): void;
13
+ clear(): void;
14
+ }
@@ -3,3 +3,4 @@ export type * from './storage-source';
3
3
  export type * from './pwa-install';
4
4
  export type * from './project-storage';
5
5
  export type * from './background-tasks';
6
+ export type * from './clipboard';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@septkit/shell-lib",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -13,8 +13,8 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "@dialecte/core": "0.14.0",
17
- "@dialecte/scl": "0.27.0"
16
+ "@dialecte/core": "0.17.1",
17
+ "@dialecte/scl": "0.31.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "oxlint": "~1.6.0",