Include dist files

This commit is contained in:
metacryst
2026-06-25 16:43:38 -05:00
parent 92eb626cb9
commit 74f488f242
18 changed files with 269 additions and 12 deletions

View File

@@ -0,0 +1,65 @@
import type { PluginListenerHandle } from '@capacitor/core';
/** A network row rendered in the sidebar. Shapes match `global.networks`. */
export interface SidebarNetwork {
id: number;
name: string;
abbreviation: string;
logo?: string | null;
displayOrder?: number;
data?: {
announcements?: { text: string }[];
members?: { id: number }[];
};
}
export interface SidebarProfile {
id: number;
first_name?: string;
last_name?: string;
email?: string;
image_path?: string | null;
}
export interface SidebarData {
/** Origin that serves the UI (quill.js, Sidebar.js, host page). */
uiOrigin: string;
/** Origin that serves images (logos, avatars). */
serverOrigin: string;
profile: SidebarProfile;
networks: SidebarNetwork[];
currentNetworkId?: number | null;
/** Current theme key: light | parchment | dark | red. */
theme?: string;
/** Whether the current user may create networks. */
canCreateNetwork?: boolean;
}
/** An action forwarded from the sidebar's content web view to the main app. */
export interface SidebarAction {
type: 'selectNetwork' | 'openProfile' | 'createNetwork' | 'setTheme' | 'logout';
abbreviation?: string;
value?: string;
}
export interface NativeSidebarPlugin {
/** Create (pre-warm) the drawer if needed and push the latest data into it. */
setData(data: SidebarData): Promise<void>;
/** Update just the theme (key) without re-sending all data. */
setTheme(options: { theme: string }): Promise<void>;
/** Animate the drawer open. */
open(): Promise<void>;
/** Animate the drawer closed. */
close(): Promise<void>;
/** Enable/disable the edge-drag gesture (disabled on deep routes). */
setEnabled(options: { enabled: boolean }): Promise<void>;
/** Tear down the drawer entirely. */
dismiss(): Promise<void>;
/** Fires when the user taps something in the sidebar content. */
addListener(eventName: 'action', listenerFunc: (data: SidebarAction) => void): Promise<PluginListenerHandle>;
/** Fires when the drawer finishes opening/closing. */
addListener(eventName: 'stateChange', listenerFunc: (data: { open: boolean }) => void): Promise<PluginListenerHandle>;
removeAllListeners(): Promise<void>;
}

View File

@@ -0,0 +1 @@
export {};

4
native-sidebar/dist/esm/index.d.ts vendored Normal file
View File

@@ -0,0 +1,4 @@
import type { NativeSidebarPlugin } from './definitions';
declare const NativeSidebar: NativeSidebarPlugin;
export * from './definitions';
export { NativeSidebar };

8
native-sidebar/dist/esm/index.js vendored Normal file
View File

@@ -0,0 +1,8 @@
import { registerPlugin } from '@capacitor/core';
const NativeSidebar = registerPlugin('NativeSidebar', {
web: () => import('./web').then(m => new m.NativeSidebarWeb()),
});
export * from './definitions';
export { NativeSidebar };

11
native-sidebar/dist/esm/web.d.ts vendored Normal file
View File

@@ -0,0 +1,11 @@
import { WebPlugin } from '@capacitor/core';
import type { NativeSidebarPlugin } from './definitions';
export declare class NativeSidebarWeb extends WebPlugin implements NativeSidebarPlugin {
setData(): Promise<void>;
setTheme(): Promise<void>;
open(): Promise<void>;
close(): Promise<void>;
setEnabled(): Promise<void>;
dismiss(): Promise<void>;
addListener(eventName: any, listenerFunc: any): Promise<any>;
}

13
native-sidebar/dist/esm/web.js vendored Normal file
View File

@@ -0,0 +1,13 @@
import { WebPlugin } from '@capacitor/core';
// No-op web implementation so the plugin import resolves in the browser build.
// The drawer is iOS-native only; on web these methods are never the active path
// but must exist to avoid runtime crashes.
export class NativeSidebarWeb extends WebPlugin {
async setData() { /* no-op on web */ }
async setTheme() { /* no-op on web */ }
async open() { /* no-op on web */ }
async close() { /* no-op on web */ }
async setEnabled() { /* no-op on web */ }
async dismiss() { /* no-op on web */ }
}

21
native-sidebar/dist/plugin.cjs.js vendored Normal file
View File

@@ -0,0 +1,21 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const core = require('@capacitor/core');
class NativeSidebarWeb extends core.WebPlugin {
async setData() {}
async setTheme() {}
async open() {}
async close() {}
async setEnabled() {}
async dismiss() {}
}
const NativeSidebar = core.registerPlugin('NativeSidebar', {
web: () => Promise.resolve(new NativeSidebarWeb()),
});
exports.NativeSidebar = NativeSidebar;
exports.NativeSidebarWeb = NativeSidebarWeb;