1
0
silverbullet/plug-api/app_event.ts

75 lines
1.4 KiB
TypeScript
Raw Normal View History

import type { ParseTree } from "$sb/lib/tree.ts";
WIP: Plug API document change event (#488) * add support for basic on doc change event * move change API core into plug-api/lib; add docs * add overlap utility * Maintain modal focus * Federated URL backend handling * Fix small typo in Query.md (#483) * Federation progress * Cleanup and federation prep * Robustness and federation sync * Federation: rewrite page references in federated content * Don't sync service worker and index.json to client on silverbullet.md * Federation listing timeouts * Switching onboarding over to federation links * Reduce amount of sync related log messages a bit * Attribute indexing and code completion * Shift-Enter in the page navigator now takes the input literally * Updated changelog * Completion for handlebar template variables * Make 'pos' a number in tasks * Updated install instructions to include edge builds * WIP: CLI running of plugs * Upgrade deno in Docker to 1.36.0 * Implement CLI store using Deno store * Rerun directives * Fixes #485 * 0.3.8 * 0.3.9 * Changelog * Instantly sync updated pages when ticking off a task in a directive * Sync current open page every 5s * Optimize requests * Make attribute extensible * Debugging sync getting stuck * Misaligning sync cycles (to avoid no-op cycles) * Fixes #500: New apply page template command * Changelog * More sync debugging statements * More sync debugging * Even more debug * Dial down excessive debug logging * Fixes #115: By introducing MQ workers * Use MQ for updating directives in entire space * Work on plug:run * touch up docs * Fix htmlLanguage dependency --------- Co-authored-by: Zef Hemel <zef@zef.me> Co-authored-by: johnl <johnlunney@users.noreply.github.com>
2023-08-16 13:15:19 +00:00
import { TextChange } from "$sb/lib/change.ts";
import { Query } from "$sb/types.ts";
2022-07-11 07:08:22 +00:00
export type AppEvent =
| "page:click"
| "editor:complete"
| "minieditor:complete"
2023-11-06 08:14:16 +00:00
| "slash:complete"
2022-07-11 07:08:22 +00:00
| "page:load"
| "editor:init"
| "editor:pageLoaded" // args: pageName, previousPage, isSynced
2023-01-26 14:54:28 +00:00
| "editor:pageReloaded"
| "editor:pageSaved"
2023-01-23 17:52:17 +00:00
| "editor:modeswitch"
WIP: Plug API document change event (#488) * add support for basic on doc change event * move change API core into plug-api/lib; add docs * add overlap utility * Maintain modal focus * Federated URL backend handling * Fix small typo in Query.md (#483) * Federation progress * Cleanup and federation prep * Robustness and federation sync * Federation: rewrite page references in federated content * Don't sync service worker and index.json to client on silverbullet.md * Federation listing timeouts * Switching onboarding over to federation links * Reduce amount of sync related log messages a bit * Attribute indexing and code completion * Shift-Enter in the page navigator now takes the input literally * Updated changelog * Completion for handlebar template variables * Make 'pos' a number in tasks * Updated install instructions to include edge builds * WIP: CLI running of plugs * Upgrade deno in Docker to 1.36.0 * Implement CLI store using Deno store * Rerun directives * Fixes #485 * 0.3.8 * 0.3.9 * Changelog * Instantly sync updated pages when ticking off a task in a directive * Sync current open page every 5s * Optimize requests * Make attribute extensible * Debugging sync getting stuck * Misaligning sync cycles (to avoid no-op cycles) * Fixes #500: New apply page template command * Changelog * More sync debugging statements * More sync debugging * Even more debug * Dial down excessive debug logging * Fixes #115: By introducing MQ workers * Use MQ for updating directives in entire space * Work on plug:run * touch up docs * Fix htmlLanguage dependency --------- Co-authored-by: Zef Hemel <zef@zef.me> Co-authored-by: johnl <johnlunney@users.noreply.github.com>
2023-08-16 13:15:19 +00:00
| "plugs:loaded"
| "editor:pageModified";
2022-10-14 13:11:33 +00:00
export type QueryProviderEvent = {
query: Query;
2022-10-14 13:11:33 +00:00
pageName: string;
};
export type ClickEvent = {
2022-03-28 13:25:05 +00:00
page: string;
pos: number;
metaKey: boolean;
ctrlKey: boolean;
altKey: boolean;
};
export type IndexEvent = {
name: string;
text: string;
};
export type IndexTreeEvent = {
name: string;
tree: ParseTree;
};
2022-11-24 15:08:51 +00:00
export type PublishEvent = {
uri: string;
// Page name
name: string;
};
export type CompleteEvent = {
pageName: string;
linePrefix: string;
pos: number;
2023-08-01 19:35:19 +00:00
parentNodes: string[];
};
2023-01-21 12:37:55 +00:00
2023-11-06 08:14:16 +00:00
export type SlashCompletion = {
label: string;
detail?: string;
invoke: string;
} & Record<string, any>;
2023-01-21 12:37:55 +00:00
export type WidgetContent = {
html?: string;
script?: string;
2023-10-29 09:02:50 +00:00
markdown?: string;
2023-01-21 12:37:55 +00:00
url?: string;
height?: number;
width?: number;
};
WIP: Plug API document change event (#488) * add support for basic on doc change event * move change API core into plug-api/lib; add docs * add overlap utility * Maintain modal focus * Federated URL backend handling * Fix small typo in Query.md (#483) * Federation progress * Cleanup and federation prep * Robustness and federation sync * Federation: rewrite page references in federated content * Don't sync service worker and index.json to client on silverbullet.md * Federation listing timeouts * Switching onboarding over to federation links * Reduce amount of sync related log messages a bit * Attribute indexing and code completion * Shift-Enter in the page navigator now takes the input literally * Updated changelog * Completion for handlebar template variables * Make 'pos' a number in tasks * Updated install instructions to include edge builds * WIP: CLI running of plugs * Upgrade deno in Docker to 1.36.0 * Implement CLI store using Deno store * Rerun directives * Fixes #485 * 0.3.8 * 0.3.9 * Changelog * Instantly sync updated pages when ticking off a task in a directive * Sync current open page every 5s * Optimize requests * Make attribute extensible * Debugging sync getting stuck * Misaligning sync cycles (to avoid no-op cycles) * Fixes #500: New apply page template command * Changelog * More sync debugging statements * More sync debugging * Even more debug * Dial down excessive debug logging * Fixes #115: By introducing MQ workers * Use MQ for updating directives in entire space * Work on plug:run * touch up docs * Fix htmlLanguage dependency --------- Co-authored-by: Zef Hemel <zef@zef.me> Co-authored-by: johnl <johnlunney@users.noreply.github.com>
2023-08-16 13:15:19 +00:00
/** PageModifiedEvent payload for "editor:pageModified". Fired when the document text changes
*/
export type PageModifiedEvent = {
changes: TextChange[];
};