@binblink/wasmnest-plugin-sdk-mobile 0.0.0-stage → 0.0.1

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 (114) hide show
  1. package/README.md +363 -2
  2. package/README_en.md +353 -0
  3. package/bin/build.js +269 -0
  4. package/bin/cli.js +96 -0
  5. package/bin/lib.js +349 -0
  6. package/bin/manifest-gen.js +324 -0
  7. package/bin/package.js +150 -0
  8. package/bin/scaffold.js +285 -0
  9. package/dev-shell/README.md +151 -0
  10. package/dev-shell/index.html +27 -0
  11. package/dev-shell/package.json +27 -0
  12. package/dev-shell/pnpm-workspace.yaml +9 -0
  13. package/dev-shell/postcss.config.js +6 -0
  14. package/dev-shell/src/App.vue +90 -0
  15. package/dev-shell/src/apps/mock-terminal/MockTerminalSlotCard.vue +51 -0
  16. package/dev-shell/src/apps/mock-terminal/MockTerminalView.vue +168 -0
  17. package/dev-shell/src/apps/mock-terminal/index.ts +50 -0
  18. package/dev-shell/src/components/DevToolbar.vue +100 -0
  19. package/dev-shell/src/components/DialogHost.vue +119 -0
  20. package/dev-shell/src/components/LogPanel.vue +80 -0
  21. package/dev-shell/src/i18n.ts +22 -0
  22. package/dev-shell/src/loader.ts +239 -0
  23. package/dev-shell/src/locale.ts +29 -0
  24. package/dev-shell/src/locales/en-shell.ts +328 -0
  25. package/dev-shell/src/locales/index.ts +70 -0
  26. package/dev-shell/src/locales/shell.ts +328 -0
  27. package/dev-shell/src/main.ts +58 -0
  28. package/dev-shell/src/mock/dialog-service.ts +58 -0
  29. package/dev-shell/src/mock/file-transfer.ts +390 -0
  30. package/dev-shell/src/mock/mobile-api.ts +369 -0
  31. package/dev-shell/src/mock/preset-tasks.ts +186 -0
  32. package/dev-shell/src/mock/session.ts +121 -0
  33. package/dev-shell/src/mock-context.ts +351 -0
  34. package/dev-shell/src/registry.ts +151 -0
  35. package/dev-shell/src/shared-runtime.ts +44 -0
  36. package/dev-shell/src/shell/ShellView.vue +52 -0
  37. package/dev-shell/src/shell/adapters/devAppSource.ts +155 -0
  38. package/dev-shell/src/shell/components/PluginContextHost.vue +40 -0
  39. package/dev-shell/src/shell/components/ShellAppCell.vue +75 -0
  40. package/dev-shell/src/shell/components/ShellAppIcon.vue +111 -0
  41. package/dev-shell/src/shell/components/ShellAppSurface.vue +46 -0
  42. package/dev-shell/src/shell/components/ShellBrandTile.vue +27 -0
  43. package/dev-shell/src/shell/components/ShellCapsuleMenu.vue +123 -0
  44. package/dev-shell/src/shell/components/ShellChip.vue +49 -0
  45. package/dev-shell/src/shell/components/ShellGroupCard.vue +17 -0
  46. package/dev-shell/src/shell/components/ShellHost.vue +75 -0
  47. package/dev-shell/src/shell/components/ShellNotificationShade.vue +496 -0
  48. package/dev-shell/src/shell/components/ShellPermissionPrompt.vue +127 -0
  49. package/dev-shell/src/shell/components/ShellPlaceholderSurface.vue +33 -0
  50. package/dev-shell/src/shell/components/ShellSection.vue +27 -0
  51. package/dev-shell/src/shell/components/ShellSheet.vue +74 -0
  52. package/dev-shell/src/shell/components/ShellStatusbar.vue +84 -0
  53. package/dev-shell/src/shell/components/screens/PluginRoutePage.vue +98 -0
  54. package/dev-shell/src/shell/components/screens/ShellAppDetailScreen.vue +378 -0
  55. package/dev-shell/src/shell/components/screens/ShellAppRunScreen.vue +90 -0
  56. package/dev-shell/src/shell/components/screens/ShellAppsScreen.vue +195 -0
  57. package/dev-shell/src/shell/components/screens/ShellHomeScreen.vue +316 -0
  58. package/dev-shell/src/shell/components/screens/ShellPermissionsScreen.vue +376 -0
  59. package/dev-shell/src/shell/components/screens/ShellSettingsScreen.vue +240 -0
  60. package/dev-shell/src/shell/components/screens/ShellSwitcherScreen.vue +559 -0
  61. package/dev-shell/src/shell/components/ui/ConfirmDialog.vue +137 -0
  62. package/dev-shell/src/shell/components/ui/Toggle.vue +53 -0
  63. package/dev-shell/src/shell/composables/useShellApps.ts +415 -0
  64. package/dev-shell/src/shell/composables/useShellNavigation.ts +197 -0
  65. package/dev-shell/src/shell/composables/useShellNotifications.ts +115 -0
  66. package/dev-shell/src/shell/composables/useShellOpen.ts +35 -0
  67. package/dev-shell/src/shell/composables/useShellOverlays.ts +101 -0
  68. package/dev-shell/src/shell/composables/useShellPreferences.ts +143 -0
  69. package/dev-shell/src/shell/composables/useShellRecent.ts +84 -0
  70. package/dev-shell/src/shell/composables/useToast.ts +33 -0
  71. package/dev-shell/src/shell/index.ts +88 -0
  72. package/dev-shell/src/shell/logger.ts +45 -0
  73. package/dev-shell/src/shell/permissions.ts +145 -0
  74. package/dev-shell/src/shell/registry.ts +220 -0
  75. package/dev-shell/src/shell/styles/shell.css +841 -0
  76. package/dev-shell/src/shell/types.ts +137 -0
  77. package/dev-shell/src/shell/utils.ts +54 -0
  78. package/dev-shell/src/styles/main.css +153 -0
  79. package/dev-shell/src/styles/mobile.css +884 -0
  80. package/dev-shell/src/styles/wallpaper.css +130 -0
  81. package/dev-shell/src/theme.ts +71 -0
  82. package/dev-shell/src/vite-env.d.ts +20 -0
  83. package/dev-shell/tailwind.config.js +101 -0
  84. package/dev-shell/tsconfig.json +16 -0
  85. package/dev-shell/vite.config.ts +130 -0
  86. package/dist/index.d.ts +84 -0
  87. package/dist/index.js +161 -0
  88. package/dist/types.d.ts +637 -0
  89. package/dist/types.js +0 -0
  90. package/dist/vite-plugin.d.ts +16 -0
  91. package/dist/vite-plugin.js +95 -0
  92. package/package.json +80 -3
  93. package/src/constants.ts +6 -0
  94. package/src/global-dialog.ts +168 -0
  95. package/src/index.ts +87 -0
  96. package/src/runtime.ts +44 -0
  97. package/src/types.ts +715 -0
  98. package/src/ui/PluginGlobalDialog.vue +388 -0
  99. package/src/ui/Select.d.ts +37 -0
  100. package/src/ui/Select.vue +307 -0
  101. package/src/ui/plugin-global-dialog.d.ts +11 -0
  102. package/src/ui/useSwipeTabs.d.ts +20 -0
  103. package/src/ui/useSwipeTabs.ts +53 -0
  104. package/src/vite-plugin.ts +132 -0
  105. package/template/.gitignore +4 -0
  106. package/template/README.md +46 -0
  107. package/template/package.json +23 -0
  108. package/template/plugin.json +13 -0
  109. package/template/rust/Cargo.toml +19 -0
  110. package/template/rust/src/lib.rs +33 -0
  111. package/template/src/env.d.ts +24 -0
  112. package/template/src/index.ts +37 -0
  113. package/template/tsconfig.json +17 -0
  114. package/template/vite.config.ts +21 -0
@@ -0,0 +1,24 @@
1
+ /**
2
+ * SDK 类型环境声明(模板自身用)
3
+ *
4
+ * 模板是 create 命令生成的样板工程,生成前不依赖 node_modules——本声明让
5
+ * tsserver 在模板目录内可解析 SDK 包名(避免 Cannot find module 假阳性)。
6
+ * 生成的插件工程 `pnpm install` 后以真实 SDK 类型为准(ambient 声明优先级
7
+ * 低于实际模块解析,自动被覆盖),此文件仅作模板开发期的类型兜底。
8
+ */
9
+ declare module '@binblink/wasmnest-plugin-sdk-mobile' {
10
+ /** 插件上下文(最小可编译形状;生成工程以 SDK 真实类型为准) */
11
+ export interface PluginContext {
12
+ [key: string]: unknown
13
+ }
14
+ }
15
+
16
+ declare module '@binblink/wasmnest-plugin-sdk-mobile/ui' {
17
+ import type { DefineComponent } from 'vue'
18
+ const component: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>
19
+ export default component
20
+ }
21
+
22
+ declare module '@binblink/wasmnest-plugin-sdk-mobile/vite' {
23
+ export function wasmnestPlugin(options?: Record<string, unknown>): unknown
24
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * {{NAME}} 应用入口 (Mobile)
3
+ *
4
+ * 最小可编译模板:激活时注册一个宿主壳运行面(registerSurface)。
5
+ *
6
+ * 票 2026-10-10 批次 C2:模板原用 `registerTerminalToolbarItem`(终端工具栏项),
7
+ * 该扩展点已随宿主壳改纯 surface 形态整面退役。应用在壳内的运行面只有一种形态——
8
+ * `registerSurface`:应用自持整个界面(含底部导航与页签),壳不向其内加壳 chrome。
9
+ */
10
+ import type { PluginContext } from '@binblink/wasmnest-plugin-sdk-mobile'
11
+ import { defineComponent, h } from 'vue'
12
+
13
+ let _ctx: PluginContext
14
+
15
+ export async function activate(context: PluginContext): Promise<void> {
16
+ _ctx = context
17
+ context.logger.info('{{NAME}} app activating...')
18
+
19
+ context.ui.registerSurface({
20
+ component: defineComponent({
21
+ name: '{{ID}}Surface',
22
+ setup() {
23
+ return () =>
24
+ h('div', { class: 'p-4 text-sm' }, [
25
+ h('p', '{{NAME}} 运行面'),
26
+ h('p', { class: 'opacity-70 mt-2' }, '在这里放你的应用界面(底部导航 / 页签由应用自持)'),
27
+ ])
28
+ },
29
+ }),
30
+ })
31
+
32
+ context.logger.info('{{NAME}} app activated')
33
+ }
34
+
35
+ export async function deactivate(): Promise<void> {
36
+ _ctx?.logger.info('{{NAME}} app deactivated')
37
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "jsx": "preserve",
8
+ "resolveJsonModule": true,
9
+ "isolatedModules": true,
10
+ "esModuleInterop": true,
11
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
12
+ "skipLibCheck": true,
13
+ "noEmit": true
14
+ },
15
+ "include": ["src/**/*.ts", "src/**/*.vue"],
16
+ "exclude": ["node_modules", "rust"]
17
+ }
@@ -0,0 +1,21 @@
1
+ import { defineConfig } from 'vite'
2
+ import vue from '@vitejs/plugin-vue'
3
+ import { resolve } from 'path'
4
+ import { wasmnestPlugin } from '@binblink/wasmnest-plugin-sdk-mobile/vite'
5
+
6
+ export default defineConfig({
7
+ plugins: [vue(), wasmnestPlugin()],
8
+ define: {
9
+ 'process.env.NODE_ENV': JSON.stringify('production'),
10
+ },
11
+ build: {
12
+ lib: {
13
+ entry: resolve(__dirname, 'src/index.ts'),
14
+ formats: ['es'],
15
+ fileName: () => 'index.js',
16
+ },
17
+ outDir: resolve(__dirname, 'dist'),
18
+ emptyOutDir: true,
19
+ minify: 'terser',
20
+ },
21
+ })