create-lupine 1.0.31 → 1.3.0

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 (269) hide show
  1. package/README.md +31 -0
  2. package/index.js +238 -112
  3. package/package.json +1 -1
  4. package/templates/common/.agents/skills/lupine-framework/SKILL.md +63 -0
  5. package/templates/common/.agents/skills/lupine-framework/references/backend-api.md +113 -0
  6. package/templates/common/.agents/skills/lupine-framework/references/icon-handling.md +71 -0
  7. package/templates/common/.agents/skills/lupine-framework/references/mobile-interactions.md +29 -0
  8. package/templates/common/.agents/skills/lupine-framework/references/native-apps.md +190 -0
  9. package/templates/common/.agents/skills/lupine-framework/references/navigation-and-routing.md +55 -0
  10. package/templates/common/.agents/skills/lupine-framework/references/reactivity-and-state.md +108 -0
  11. package/templates/common/.agents/skills/lupine-framework/references/styling-and-themes.md +121 -0
  12. package/templates/common/.env.mobile +4 -3
  13. package/templates/common/_env +10 -4
  14. package/templates/common/apps/server/README.md +10 -0
  15. package/templates/common/dev/cp-folder.js +9 -4
  16. package/templates/lupine-template-cv-starter/README.md +37 -0
  17. package/templates/lupine-template-cv-starter/app/package.json +20 -0
  18. package/templates/lupine-template-cv-starter/app/src/app.tsx +6 -0
  19. package/templates/lupine-template-cv-starter/app/src/index.native.tsx +4 -0
  20. package/templates/lupine-template-cv-starter/app/src/index.test.tsx +71 -0
  21. package/templates/lupine-template-cv-starter/app/src/index.web.tsx +28 -0
  22. package/templates/lupine-template-cv-starter/app/tsconfig.json +17 -0
  23. package/templates/lupine-template-cv-starter/lupine.json +8 -7
  24. package/templates/lupine-template-cv-starter/web/src/index.html +9 -2
  25. package/templates/lupine-template-cv-starter/web/src/index.tsx +9 -23
  26. package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.html +9 -2
  27. package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.tsx +4 -29
  28. package/templates/lupine-template-doc-starter/README.md +37 -0
  29. package/templates/lupine-template-doc-starter/app/package.json +20 -0
  30. package/templates/lupine-template-doc-starter/app/src/app.tsx +6 -0
  31. package/templates/lupine-template-doc-starter/app/src/index.native.tsx +4 -0
  32. package/templates/lupine-template-doc-starter/app/src/index.test.tsx +78 -0
  33. package/templates/lupine-template-doc-starter/app/src/index.web.tsx +28 -0
  34. package/templates/lupine-template-doc-starter/app/tsconfig.json +17 -0
  35. package/templates/lupine-template-doc-starter/lupine.json +8 -7
  36. package/templates/lupine-template-doc-starter/web/src/index.html +9 -2
  37. package/templates/lupine-template-doc-starter/web/src/index.tsx +9 -23
  38. package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.html +9 -2
  39. package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.tsx +4 -29
  40. package/templates/lupine-template-fullstack-note/README.md +83 -0
  41. package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/api/package.json +1 -1
  42. package/templates/lupine-template-fullstack-note/api/resources/install.mysql.sql +32 -0
  43. package/templates/lupine-template-fullstack-note/api/resources/install.sqlite.sql +27 -0
  44. package/templates/lupine-template-fullstack-note/api/src/service/answer.ts +39 -0
  45. package/templates/lupine-template-fullstack-note/api/src/service/api.ts +52 -0
  46. package/templates/lupine-template-fullstack-note/api/src/service/db.ts +78 -0
  47. package/templates/lupine-template-fullstack-note/api/src/service/notes-api.ts +86 -0
  48. package/templates/lupine-template-fullstack-note/api/src/service/root-api.ts +19 -0
  49. package/templates/lupine-template-fullstack-note/api/src/service/user-api.ts +182 -0
  50. package/templates/lupine-template-fullstack-note/app/package.json +19 -0
  51. package/templates/lupine-template-fullstack-note/app/src/app.tsx +75 -0
  52. package/templates/lupine-template-fullstack-note/app/src/index.native.tsx +4 -0
  53. package/templates/lupine-template-fullstack-note/app/src/index.test.tsx +373 -0
  54. package/templates/lupine-template-fullstack-note/app/src/index.web.tsx +20 -0
  55. package/templates/lupine-template-fullstack-note/app/src/pages/components.tsx +65 -0
  56. package/templates/lupine-template-fullstack-note/app/src/pages/details.tsx +38 -0
  57. package/templates/lupine-template-fullstack-note/app/src/pages/discover.tsx +25 -0
  58. package/templates/lupine-template-fullstack-note/app/src/pages/home.tsx +76 -0
  59. package/templates/lupine-template-fullstack-note/app/src/pages/inbox.tsx +49 -0
  60. package/templates/lupine-template-fullstack-note/app/src/pages/login.tsx +54 -0
  61. package/templates/lupine-template-fullstack-note/app/src/pages/me.tsx +32 -0
  62. package/templates/lupine-template-fullstack-note/app/src/pages/notes.tsx +128 -0
  63. package/templates/lupine-template-fullstack-note/app/src/pages/settings.tsx +45 -0
  64. package/templates/lupine-template-fullstack-note/app/src/shell/AppMenu.tsx +44 -0
  65. package/templates/lupine-template-fullstack-note/app/src/shell/api.ts +159 -0
  66. package/templates/lupine-template-fullstack-note/app/src/shell/data.ts +20 -0
  67. package/templates/lupine-template-fullstack-note/app/src/shell/locales/ja.ts +80 -0
  68. package/templates/lupine-template-fullstack-note/app/src/shell/locales/zh-CN.ts +80 -0
  69. package/templates/lupine-template-fullstack-note/app/src/shell/texts.ts +14 -0
  70. package/templates/lupine-template-fullstack-note/app/tsconfig.json +17 -0
  71. package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/lupine.json +4 -2
  72. package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/web/package.json +1 -1
  73. package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/web/src/index.html +10 -3
  74. package/templates/lupine-template-fullstack-note/web/src/index.tsx +15 -0
  75. package/templates/lupine-template-fullstack-starter/README.md +70 -0
  76. package/templates/lupine-template-fullstack-starter/api/package.json +10 -0
  77. package/templates/lupine-template-fullstack-starter/api/resources/install.mysql.sql +107 -0
  78. package/templates/lupine-template-fullstack-starter/api/resources/install.sqlite.sql +75 -0
  79. package/templates/lupine-template-fullstack-starter/api/src/lang/api-lang-en.ts +39 -0
  80. package/templates/lupine-template-fullstack-starter/api/src/lang/api-lang-zh-cn.ts +37 -0
  81. package/templates/lupine-template-fullstack-starter/api/src/service/admin-api.ts +139 -0
  82. package/templates/lupine-template-fullstack-starter/api/src/service/api.ts +111 -0
  83. package/templates/lupine-template-fullstack-starter/api/src/service/contact-api.ts +50 -0
  84. package/templates/lupine-template-fullstack-starter/api/src/service/file-api-base.ts +30 -0
  85. package/templates/lupine-template-fullstack-starter/api/src/service/root-api.ts +28 -0
  86. package/templates/lupine-template-fullstack-starter/api/src/service/send-email.ts +47 -0
  87. package/templates/lupine-template-fullstack-starter/api/src/service/setting-api.ts +60 -0
  88. package/templates/lupine-template-fullstack-starter/api/src/service/user-api.ts +1046 -0
  89. package/templates/lupine-template-fullstack-starter/app/assets/sample.png +0 -0
  90. package/templates/lupine-template-fullstack-starter/app/package.json +20 -0
  91. package/templates/lupine-template-fullstack-starter/app/src/app.tsx +76 -0
  92. package/templates/lupine-template-fullstack-starter/app/src/index.native.tsx +4 -0
  93. package/templates/lupine-template-fullstack-starter/app/src/index.test.tsx +276 -0
  94. package/templates/lupine-template-fullstack-starter/app/src/index.web.tsx +28 -0
  95. package/templates/lupine-template-fullstack-starter/app/src/pages/about.tsx +27 -0
  96. package/templates/lupine-template-fullstack-starter/app/src/pages/contact.tsx +41 -0
  97. package/templates/lupine-template-fullstack-starter/app/src/pages/favorite.tsx +27 -0
  98. package/templates/lupine-template-fullstack-starter/app/src/pages/home.tsx +63 -0
  99. package/templates/lupine-template-fullstack-starter/app/src/pages/login.tsx +63 -0
  100. package/templates/lupine-template-fullstack-starter/app/src/pages/mine.tsx +44 -0
  101. package/templates/lupine-template-fullstack-starter/app/src/pages/profile.tsx +58 -0
  102. package/templates/lupine-template-fullstack-starter/app/src/pages/register.tsx +48 -0
  103. package/templates/lupine-template-fullstack-starter/app/src/pages/reset-password.tsx +41 -0
  104. package/templates/lupine-template-fullstack-starter/app/src/pages/settings.tsx +33 -0
  105. package/templates/lupine-template-fullstack-starter/app/src/pages/story.tsx +46 -0
  106. package/templates/lupine-template-fullstack-starter/app/src/shell/api.ts +127 -0
  107. package/templates/lupine-template-fullstack-starter/app/src/shell/parts.tsx +100 -0
  108. package/templates/lupine-template-fullstack-starter/app/src/shell/stories.ts +65 -0
  109. package/templates/lupine-template-fullstack-starter/app/src/shell/texts.ts +79 -0
  110. package/templates/lupine-template-fullstack-starter/app/tsconfig.json +17 -0
  111. package/templates/lupine-template-fullstack-starter/lupine.json +31 -0
  112. package/templates/lupine-template-fullstack-starter/web/assets/android-chrome-192x192.png +0 -0
  113. package/templates/lupine-template-fullstack-starter/web/assets/apple-touch-icon.png +0 -0
  114. package/templates/lupine-template-fullstack-starter/web/assets/favicon-16x16.png +0 -0
  115. package/templates/lupine-template-fullstack-starter/web/assets/favicon-32x32.png +0 -0
  116. package/templates/lupine-template-fullstack-starter/web/assets/favicon.ico +0 -0
  117. package/templates/lupine-template-fullstack-starter/web/assets/icons-font/License-carbon-icons.txt +71 -0
  118. package/templates/lupine-template-fullstack-starter/web/assets/icons-font/License-material-design.txt +20 -0
  119. package/templates/lupine-template-fullstack-starter/web/assets/icons-font/i-font.woff2 +0 -0
  120. package/templates/lupine-template-fullstack-starter/web/assets/icons-font/sample.html +124 -0
  121. package/templates/lupine-template-fullstack-starter/web/assets/icons-font/style.css +103 -0
  122. package/templates/lupine-template-fullstack-starter/web/assets/lupine-flower.png +0 -0
  123. package/templates/lupine-template-fullstack-starter/web/assets/lupine.svg +71 -0
  124. package/templates/lupine-template-fullstack-starter/web/assets/site.webmanifest +14 -0
  125. package/templates/lupine-template-fullstack-starter/web/icons-font.config.js +129 -0
  126. package/templates/{lupine-template-responsive-starter/api → lupine-template-fullstack-starter/web}/package.json +1 -1
  127. package/templates/lupine-template-fullstack-starter/web/src/admin/admin-patch.tsx +34 -0
  128. package/templates/lupine-template-fullstack-starter/web/src/admin/components/home-search-component.tsx +125 -0
  129. package/templates/lupine-template-fullstack-starter/web/src/admin/components/story-card.tsx +105 -0
  130. package/templates/lupine-template-fullstack-starter/web/src/admin/components/story-list.tsx +105 -0
  131. package/templates/lupine-template-fullstack-starter/web/src/admin/components/story-props.ts +34 -0
  132. package/templates/lupine-template-fullstack-starter/web/src/admin/index.html +23 -0
  133. package/templates/lupine-template-fullstack-starter/web/src/admin/index.tsx +49 -0
  134. package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-cfg.tsx +144 -0
  135. package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-item-edit.tsx +20 -0
  136. package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-item-list.tsx +23 -0
  137. package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-user.tsx +145 -0
  138. package/templates/lupine-template-fullstack-starter/web/src/index.html +28 -0
  139. package/templates/lupine-template-fullstack-starter/web/src/index.tsx +16 -0
  140. package/templates/lupine-template-fullstack-starter/web/src/services/fetch-data.ts +37 -0
  141. package/templates/lupine-template-fullstack-starter/web/src/styles/base-css.ts +14 -0
  142. package/templates/{lupine-template-hello-world → lupine-template-fullstack-starter}/web/src/styles/global.css +10 -57
  143. package/templates/{lupine-template-hello-world → lupine-template-fullstack-starter}/web/src/styles/theme.ts +2 -1
  144. package/templates/lupine-template-responsive-starter/README.md +51 -0
  145. package/templates/lupine-template-responsive-starter/app/package.json +19 -0
  146. package/templates/lupine-template-responsive-starter/app/src/app.tsx +80 -0
  147. package/templates/lupine-template-responsive-starter/app/src/index.native.tsx +4 -0
  148. package/templates/lupine-template-responsive-starter/app/src/index.test.tsx +283 -0
  149. package/templates/lupine-template-responsive-starter/app/src/index.web.tsx +31 -0
  150. package/templates/lupine-template-responsive-starter/app/src/pages/about.tsx +23 -0
  151. package/templates/lupine-template-responsive-starter/app/src/pages/finance.tsx +48 -0
  152. package/templates/lupine-template-responsive-starter/app/src/pages/mine.tsx +60 -0
  153. package/templates/lupine-template-responsive-starter/app/src/pages/not-found.tsx +9 -0
  154. package/templates/lupine-template-responsive-starter/app/src/pages/note-detail.tsx +43 -0
  155. package/templates/lupine-template-responsive-starter/app/src/pages/note-edit.tsx +45 -0
  156. package/templates/lupine-template-responsive-starter/app/src/pages/note-search.tsx +62 -0
  157. package/templates/lupine-template-responsive-starter/app/src/pages/notes.tsx +71 -0
  158. package/templates/lupine-template-responsive-starter/app/src/pages/settings.tsx +55 -0
  159. package/templates/lupine-template-responsive-starter/app/src/pages/tools.tsx +112 -0
  160. package/templates/lupine-template-responsive-starter/app/src/shell/icons.ts +7 -0
  161. package/templates/lupine-template-responsive-starter/app/src/shell/layout.ts +18 -0
  162. package/templates/lupine-template-responsive-starter/app/src/shell/locales/zh-CN.ts +89 -0
  163. package/templates/lupine-template-responsive-starter/app/src/shell/menu.tsx +81 -0
  164. package/templates/lupine-template-responsive-starter/app/src/shell/nav.ts +12 -0
  165. package/templates/lupine-template-responsive-starter/app/src/shell/store.ts +72 -0
  166. package/templates/lupine-template-responsive-starter/app/src/shell/texts.ts +11 -0
  167. package/templates/lupine-template-responsive-starter/app/tsconfig.json +17 -0
  168. package/templates/lupine-template-responsive-starter/lupine.json +7 -6
  169. package/templates/lupine-template-responsive-starter/web/src/index.html +9 -2
  170. package/templates/lupine-template-responsive-starter/web/src/index.tsx +9 -34
  171. package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.html +12 -6
  172. package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.tsx +12 -31
  173. package/templates/common/AI_CONTEXT.md +0 -1002
  174. package/templates/common/apps/server/src/app-loader.ts +0 -4
  175. package/templates/lupine-template-cv-starter/api/package.json +0 -6
  176. package/templates/lupine-template-cv-starter/api/resources/install.sqlite.sql +0 -4
  177. package/templates/lupine-template-cv-starter/api/src/index.ts +0 -15
  178. package/templates/lupine-template-cv-starter/web/src/styles/base-css.ts +0 -15
  179. package/templates/lupine-template-doc-starter/api/package.json +0 -6
  180. package/templates/lupine-template-doc-starter/api/resources/config_default.json +0 -6
  181. package/templates/lupine-template-doc-starter/api/resources/install.sqlite.sql +0 -4
  182. package/templates/lupine-template-doc-starter/api/src/index.ts +0 -15
  183. package/templates/lupine-template-doc-starter/api/src/resources/config_default.json +0 -6
  184. package/templates/lupine-template-doc-starter/api/src/resources/install.sqlite.sql +0 -4
  185. package/templates/lupine-template-doc-starter/web/src/client-env-keys.ts +0 -5
  186. package/templates/lupine-template-doc-starter/web/src/styles/base-css.ts +0 -15
  187. package/templates/lupine-template-hello-world/api/resources/config_default.json +0 -6
  188. package/templates/lupine-template-hello-world/api/resources/install.sqlite.sql +0 -4
  189. package/templates/lupine-template-hello-world/api/src/service/root-api.ts +0 -18
  190. package/templates/lupine-template-hello-world/web/src/index.tsx +0 -73
  191. package/templates/lupine-template-hello-world/web/src/styles/app.css +0 -0
  192. package/templates/lupine-template-hello-world/web/src/styles/base-css.ts +0 -1
  193. package/templates/lupine-template-responsive-starter/api/resources/config_default.json +0 -6
  194. package/templates/lupine-template-responsive-starter/api/resources/install.sqlite.sql +0 -4
  195. package/templates/lupine-template-responsive-starter/api/src/service/root-api.ts +0 -18
  196. package/templates/lupine-template-responsive-starter/web/src/app-icons.ts +0 -76
  197. package/templates/lupine-template-responsive-starter/web/src/components/input-history-component.tsx +0 -93
  198. package/templates/lupine-template-responsive-starter/web/src/components/mine-about-page.tsx +0 -86
  199. package/templates/lupine-template-responsive-starter/web/src/components/mine-premium-page.tsx +0 -80
  200. package/templates/lupine-template-responsive-starter/web/src/components/mine-settings-page.tsx +0 -220
  201. package/templates/lupine-template-responsive-starter/web/src/components/mobile-top-search-menu.tsx +0 -119
  202. package/templates/lupine-template-responsive-starter/web/src/components/note-detail.tsx +0 -116
  203. package/templates/lupine-template-responsive-starter/web/src/components/note-edit.tsx +0 -154
  204. package/templates/lupine-template-responsive-starter/web/src/components/note-search-page.tsx +0 -193
  205. package/templates/lupine-template-responsive-starter/web/src/components/search-input.tsx +0 -95
  206. package/templates/lupine-template-responsive-starter/web/src/components/side-menu-content.tsx +0 -182
  207. package/templates/lupine-template-responsive-starter/web/src/frames/app-responsive-frame.tsx +0 -52
  208. package/templates/lupine-template-responsive-starter/web/src/pages/about-page.tsx +0 -43
  209. package/templates/lupine-template-responsive-starter/web/src/pages/finance-page.tsx +0 -46
  210. package/templates/lupine-template-responsive-starter/web/src/pages/home-page.tsx +0 -452
  211. package/templates/lupine-template-responsive-starter/web/src/pages/mine-page.tsx +0 -325
  212. package/templates/lupine-template-responsive-starter/web/src/pages/tools-page.tsx +0 -46
  213. package/templates/lupine-template-responsive-starter/web/src/services/local-notes-service.ts +0 -87
  214. package/templates/lupine-template-responsive-starter/web/src/services/mine-service.ts +0 -45
  215. package/templates/lupine-template-responsive-starter/web/src/styles/app.css +0 -0
  216. package/templates/lupine-template-responsive-starter/web/src/styles/base-css.ts +0 -65
  217. package/templates/lupine-template-responsive-starter/web/src/styles/global.css +0 -2130
  218. package/templates/lupine-template-responsive-starter/web/src/styles/theme.ts +0 -16
  219. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/01-experience/index.md +0 -0
  220. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/02-projects/index.md +0 -0
  221. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/03-skills/index.md +0 -0
  222. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/04-education/index.md +0 -0
  223. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/index.md +0 -0
  224. /package/templates/lupine-template-cv-starter/{web → app}/markdown/index.md +0 -0
  225. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/01-experience/index.md +0 -0
  226. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/02-projects/index.md +0 -0
  227. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/03-skills/index.md +0 -0
  228. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/04-education/index.md +0 -0
  229. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/index.md +0 -0
  230. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/01-experience/index.html +0 -0
  231. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/02-projects/index.html +0 -0
  232. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/03-skills/index.html +0 -0
  233. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/04-education/index.html +0 -0
  234. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/index.html +0 -0
  235. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/index.html +0 -0
  236. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
  237. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/01-experience/index.html +0 -0
  238. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/02-projects/index.html +0 -0
  239. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/03-skills/index.html +0 -0
  240. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/04-education/index.html +0 -0
  241. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
  242. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/index.md +0 -0
  243. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/list.md +0 -0
  244. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/install.md +0 -0
  245. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/started.md +0 -0
  246. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/index.md +0 -0
  247. /package/templates/lupine-template-doc-starter/{web → app}/markdown/index.md +0 -0
  248. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/index.md +0 -0
  249. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/list.md +0 -0
  250. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/install.md +0 -0
  251. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/started.md +0 -0
  252. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/index.md +0 -0
  253. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/index.html +0 -0
  254. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/list.html +0 -0
  255. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/install.html +0 -0
  256. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/started.html +0 -0
  257. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/index.html +0 -0
  258. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/index.html +0 -0
  259. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
  260. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/index.html +0 -0
  261. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/list.html +0 -0
  262. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/install.html +0 -0
  263. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/started.html +0 -0
  264. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
  265. /package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/api/src/index.ts +0 -0
  266. /package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/web/assets/favicon.ico +0 -0
  267. /package/templates/{lupine-template-cv-starter → lupine-template-fullstack-starter}/api/resources/config_default.json +0 -0
  268. /package/templates/{lupine-template-responsive-starter → lupine-template-fullstack-starter}/api/src/index.ts +0 -0
  269. /package/templates/{lupine-template-cv-starter/web/src → lupine-template-fullstack-starter/web/src/models}/client-env-keys.ts +0 -0
@@ -0,0 +1,71 @@
1
+ import { Child, Show, Text, View } from 'lupine.native.core';
2
+ import { col, EmptyView, Fab, formatDate, Header, IconButton, MessageBox, router, SortList, Swipeable, t, theme, Toast, tr } from 'lupine.native.components';
3
+ import * as icons from 'lupine.core/icons';
4
+ import { MenuButton } from '../shell/menu';
5
+ import { Note, notes } from '../shell/store';
6
+
7
+ /** the height of a row: SortList needs one height */
8
+ const ROW = 96;
9
+
10
+ const newNote = () => router.push('/edit');
11
+
12
+ export const confirmDelete = async (note: Note) => {
13
+ if (!(await MessageBox.confirm({ title: note.title, message: t('notes.confirmDelete', 'Delete this note?'), okText: t('ln.delete', 'Delete'), destructive: true }))) return false;
14
+ notes.remove(note.id);
15
+ Toast.info(t('notes.deleted', 'Note deleted'));
16
+ return true;
17
+ };
18
+
19
+ /** A note: tap it to read it, push it to the left to edit or delete it, drag it by its handle to move it. */
20
+ const NoteRow = (p: { note: Note; handle: Child }) => {
21
+ const { note } = p;
22
+ return (
23
+ <View style={{ height: ROW, paddingHorizontal: 12, paddingTop: 10 }}>
24
+ <View style={{ flex: 1, borderRadius: 12, overflow: 'hidden', borderWidth: 1, borderColor: () => theme().c[theme().mode === 'dark' ? 'bgElevated' : 'separator'] }}>
25
+ <Swipeable
26
+ testID={`note-${note.id}`} onPress={() => router.push(`/note/${note.id}`)}
27
+ right={[
28
+ { label: tr('notes.edit', 'Edit'), icon: icons.edit, color: '#1677ff', onPress: () => router.push('/edit', { id: note.id }), testID: `note-edit-${note.id}` },
29
+ { label: tr('ln.delete', 'Delete'), icon: icons.trash, color: '#e5383b', onPress: () => void confirmDelete(note), testID: `note-delete-${note.id}` },
30
+ ]}
31
+ >
32
+ <View style={{ height: ROW - 12, flexDirection: 'row' }}>
33
+ <View style={{ width: 6, backgroundColor: note.color || 'transparent' }} />
34
+ <View style={{ flex: 1, paddingLeft: 12, justifyContent: 'center', gap: 3 }}>
35
+ <Text numberOfLines={1} testID={`note-title-${note.id}`} style={{ fontSize: 16, fontWeight: '600', color: col('text') }}>{note.title}</Text>
36
+ <Text numberOfLines={1} style={{ fontSize: 14, color: col('textSecondary') }}>{note.content.replace(/\s+/g, ' ')}</Text>
37
+ <Text style={{ fontSize: 12, color: col('textTertiary') }}>{() => formatDate(new Date(note.updatedAt), 'datetime')}</Text>
38
+ </View>
39
+ {p.handle}
40
+ </View>
41
+ </Swipeable>
42
+ </View>
43
+ </View>
44
+ );
45
+ };
46
+
47
+ /** The first tab: the notes kept on the device. */
48
+ export const Notes = () => (
49
+ <View testID='page-notes' style={{ flex: 1, backgroundColor: col('bgSecondary') }}>
50
+ <Header
51
+ title={tr('nav.notes', 'Notes')} left={<MenuButton />}
52
+ right={<IconButton name={icons.search} color={col('headerText')} onPress={() => router.push('/search')} testID='notes-search' />}
53
+ />
54
+ <Show
55
+ when={() => notes.list().length > 0}
56
+ fallback={
57
+ <View testID='notes-empty' style={{ flex: 1, justifyContent: 'center' }}>
58
+ <EmptyView icon={icons.edit} title={tr('notes.empty', 'No notes yet')} action={tr('notes.new', 'New note')} onAction={newNote} />
59
+ </View>
60
+ }
61
+ >
62
+ <View style={{ flex: 1, width: '100%', maxWidth: 760, alignSelf: 'center' }}>
63
+ {/* space: the last one can be scrolled above the button */}
64
+ <SortList items={notes.list} onChange={notes.reorder} itemHeight={ROW} space={96} style={{ flex: 1 }} testID='notes-list'>
65
+ {(note, handle) => <NoteRow note={note} handle={handle} />}
66
+ </SortList>
67
+ </View>
68
+ </Show>
69
+ <Fab icon={icons.plus} onPress={newNote} testID='note-add' />
70
+ </View>
71
+ );
@@ -0,0 +1,55 @@
1
+ import { openURL } from 'lupine.native.core';
2
+ import { ActionSheet, lang, languages, MessageBox, router, Row, Screen, Section, setLang, setThemePref, t, themePref, themes, Toast, tr } from 'lupine.native.components';
3
+ import * as icons from 'lupine.core/icons';
4
+ import { layout, setLayout } from '../shell/layout';
5
+ import { clearAllData } from '../shell/store';
6
+
7
+ const themeName = (n: string) =>
8
+ ({ system: t('ln.themeSystem', 'System'), light: t('ln.themeLight', 'Light'), dark: t('ln.themeDark', 'Dark'), ocean: t('settings.ocean', 'Ocean'), sand: t('settings.sand', 'Sand') })[n] || n;
9
+ const layoutName = (l: string) => (l === 'sidemenu' ? t('settings.sidemenu', 'Side menu') : t('settings.tabs', 'Tabs'));
10
+
11
+ export const Settings = () => {
12
+ const pickTheme = async () => {
13
+ const v = await ActionSheet.select({ title: t('settings.theme', 'Theme'), selected: themePref(), options: ['system', ...Object.keys(themes)].map((n) => ({ label: themeName(n), value: n })) });
14
+ if (v) setThemePref(v);
15
+ };
16
+ const pickLang = async () => {
17
+ const v = await ActionSheet.select({ title: t('settings.language', 'Language'), selected: lang(), options: languages.map((l) => ({ label: l.name, value: l.code })) });
18
+ if (v) setLang(v);
19
+ };
20
+ const pickLayout = async () => {
21
+ const v = await ActionSheet.select({ title: t('settings.layout', 'Menu'), selected: layout(), options: ['tabs', 'sidemenu'].map((l) => ({ label: layoutName(l), value: l })) });
22
+ if (v === 'tabs' || v === 'sidemenu') setLayout(v);
23
+ };
24
+ const clearCache = () => setTimeout(() => Toast.success(t('settings.cacheCleared', 'Cache cleared')), 300);
25
+ const clearAll = async () => {
26
+ const ok = await MessageBox.confirm({
27
+ title: t('settings.clearAll', 'Clear all data'),
28
+ message: t('settings.clearAllText', 'All notes and searches on this device are deleted. This cannot be undone.'),
29
+ okText: t('settings.erase', 'Erase everything'),
30
+ destructive: true,
31
+ });
32
+ if (!ok) return;
33
+ clearAllData();
34
+ Toast.success(t('settings.cleared', 'All data cleared'));
35
+ };
36
+ const language = () => languages.find((l) => l.code === lang())?.name || lang();
37
+ return (
38
+ <Screen title={tr('nav.settings', 'Settings')} onBack={() => void router.back()} grouped testID='page-settings'>
39
+ <Section title={tr('settings.appearance', 'Appearance')}>
40
+ <Row label={tr('settings.theme', 'Theme')} icon={icons.palette} iconColor='#5e5ce6' value={() => themeName(themePref())} onPress={pickTheme} testID='settings-theme' />
41
+ <Row label={tr('settings.language', 'Language')} icon={icons.language} iconColor='#34c759' value={language} onPress={pickLang} testID='settings-language' />
42
+ <Row label={tr('settings.layout', 'Menu')} icon={icons.menu} iconColor='#ff9f0a' value={() => layoutName(layout())} onPress={pickLayout} testID='settings-layout' />
43
+ </Section>
44
+ <Section title={tr('settings.application', 'Application')}>
45
+ <Row label={tr('settings.feedback', 'Feedback & support')} icon={icons.chat} iconColor='#30b0c7' onPress={() => openURL('https://github.com/uuware/lupine.js/issues')} />
46
+ <Row label={tr('settings.clearCache', 'Clear temporary cache')} icon={icons.refresh} iconColor='#8e8e93' onPress={clearCache} testID='settings-clear-cache' />
47
+ <Row label={tr('nav.about', 'About')} icon={icons.info} iconColor='#1677ff' onPress={() => router.navigate('/about')} testID='settings-about' />
48
+ <Row label={tr('settings.version', 'Version')} value={APP_VERSION} />
49
+ </Section>
50
+ <Section title={tr('settings.danger', 'Danger zone')}>
51
+ <Row label={tr('settings.clearAll', 'Clear all data')} destructive onPress={clearAll} testID='settings-clear-all' />
52
+ </Section>
53
+ </Screen>
54
+ );
55
+ };
@@ -0,0 +1,112 @@
1
+ import { createSignal, media, onCleanup, Text, View } from 'lupine.native.core';
2
+ import { Button, Calendar, Card, col, ColorPicker, CopyButton, formatDate, Header, Icon, IconName, router, Screen, T, t, tr } from 'lupine.native.components';
3
+ import * as icons from 'lupine.core/icons';
4
+ import { MenuButton } from '../shell/menu';
5
+
6
+ const back = () => void router.back();
7
+
8
+ const TOOLS: { id: string; icon: IconName; title: () => string; text: () => string }[] = [
9
+ { id: 'stopwatch', icon: icons.clock, title: tr('tools.stopwatch', 'Stopwatch'), text: tr('tools.stopwatchText', 'Start, pause, reset') },
10
+ { id: 'calendar', icon: icons.calendar, title: tr('tools.calendar', 'Calendar'), text: tr('tools.calendarText', 'Days from today') },
11
+ { id: 'colors', icon: icons.palette, title: tr('tools.colors', 'Colors'), text: tr('tools.colorsText', 'Pick and copy a color') },
12
+ ];
13
+
14
+ /** Small tools, each a page of its own: add yours here. */
15
+ export const Tools = () => {
16
+ // 2 or 3 in a row, by css on the web: the page of the server is right at once
17
+ const width = media<`${number}%`>({ base: '47%', mobileAbove: '31%' });
18
+ return (
19
+ <Screen header={<Header title={tr('nav.tools', 'Tools')} left={<MenuButton />} />} grouped testID='page-tools'>
20
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 12, padding: 16 }}>
21
+ {TOOLS.map((tool) => (
22
+ <Card onPress={() => router.push(`/tools/${tool.id}`)} style={{ width, flexGrow: 1, gap: 8, paddingVertical: 18 }} testID={`tool-${tool.id}`}>
23
+ <View style={{ width: 44, height: 44, borderRadius: 12, alignItems: 'center', justifyContent: 'center', backgroundColor: col('primaryBg') }}>
24
+ <Icon name={tool.icon} color={col('primary')} />
25
+ </View>
26
+ <T kind='subtitle' numberOfLines={1}>{tool.title}</T>
27
+ <T kind='caption' numberOfLines={2}>{tool.text}</T>
28
+ </Card>
29
+ ))}
30
+ </View>
31
+ </Screen>
32
+ );
33
+ };
34
+
35
+ const two = (n: number) => String(Math.floor(n)).padStart(2, '0');
36
+ const clock = (ms: number) => `${two(ms / 60000)}:${two((ms / 1000) % 60)}.${Math.floor((ms % 1000) / 100)}`;
37
+
38
+ export const Stopwatch = () => {
39
+ const [elapsed, setElapsed] = createSignal(0);
40
+ const [running, setRunning] = createSignal(false);
41
+ let since = 0;
42
+ let timer: ReturnType<typeof setInterval> | undefined;
43
+ const stop = () => {
44
+ if (timer !== undefined) clearInterval(timer);
45
+ timer = undefined;
46
+ };
47
+ const toggle = () => {
48
+ if (running()) {
49
+ stop();
50
+ setElapsed(Date.now() - since);
51
+ setRunning(false);
52
+ } else {
53
+ since = Date.now() - elapsed();
54
+ timer = setInterval(() => setElapsed(Date.now() - since), 100);
55
+ setRunning(true);
56
+ }
57
+ };
58
+ const reset = () => {
59
+ stop();
60
+ setRunning(false);
61
+ setElapsed(0);
62
+ };
63
+ onCleanup(stop);
64
+ return (
65
+ <Screen title={tr('tools.stopwatch', 'Stopwatch')} onBack={back} padded testID='page-stopwatch'>
66
+ <View style={{ alignItems: 'center', gap: 28, paddingTop: 48 }}>
67
+ <Text testID='stopwatch-time' style={{ fontSize: 56, fontWeight: '300', color: col('text') }}>{() => clock(elapsed())}</Text>
68
+ <View style={{ flexDirection: 'row', gap: 12 }}>
69
+ <Button title={() => (running() ? t('tools.pause', 'Pause') : t('tools.start', 'Start'))} kind='primary' size='large' onPress={toggle} style={{ minWidth: 120 }} testID='stopwatch-start' />
70
+ <Button title={tr('tools.reset', 'Reset')} size='large' onPress={reset} style={{ minWidth: 120 }} testID='stopwatch-reset' />
71
+ </View>
72
+ </View>
73
+ </Screen>
74
+ );
75
+ };
76
+
77
+ const day = 24 * 3600 * 1000;
78
+ const midnight = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
79
+
80
+ export const CalendarTool = () => {
81
+ const [date, setDate] = createSignal(new Date());
82
+ const from = () => Math.round((midnight(date()) - midnight(new Date())) / day);
83
+ return (
84
+ <Screen title={tr('tools.calendar', 'Calendar')} onBack={back} padded testID='page-calendar'>
85
+ <View style={{ gap: 16, width: '100%', maxWidth: 420, alignSelf: 'center' }}>
86
+ <Card>
87
+ <Calendar value={date} onChange={setDate} testID='calendar' />
88
+ </Card>
89
+ <T kind='subtitle' style={{ textAlign: 'center' }} testID='calendar-date'>{() => formatDate(date())}</T>
90
+ <T kind='secondary' style={{ textAlign: 'center' }} testID='calendar-days'>
91
+ {() => (from() === 0 ? t('tools.today', 'Today') : from() > 0 ? t('tools.inDays', 'In {n} days', { n: from() }) : t('tools.daysAgo', '{n} days ago', { n: -from() }))}
92
+ </T>
93
+ </View>
94
+ </Screen>
95
+ );
96
+ };
97
+
98
+ export const ColorsTool = () => {
99
+ const [color, setColor] = createSignal('#1e88e5');
100
+ return (
101
+ <Screen title={tr('tools.colors', 'Colors')} onBack={back} padded testID='page-colors'>
102
+ <View style={{ gap: 16, width: '100%', maxWidth: 520, alignSelf: 'center' }}>
103
+ <View style={{ height: 96, borderRadius: 16, backgroundColor: color, borderWidth: 1, borderColor: col('border') }} />
104
+ <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 8 }}>
105
+ <T kind='subtitle' testID='colors-value'>{color}</T>
106
+ <CopyButton text={color} testID='colors-copy' />
107
+ </View>
108
+ <ColorPicker value={color} onChange={setColor} testID='colors-picker' />
109
+ </View>
110
+ </Screen>
111
+ );
112
+ };
@@ -0,0 +1,7 @@
1
+ // Icons that lupine.core/icons doesn't have: { name: path data }, 24 x 24, strokes. svgToPath of lupine.native.core
2
+ // makes the path data of an svg.
3
+ export const finance = { finance: 'M12 2L12 22M17 5L9.5 5C7.567 5 6 6.567 6 8.5C6 10.433 7.567 12 9.5 12L14.5 12C16.433 12 18 13.567 18 15.5C18 17.433 16.433 19 14.5 19L6 19' };
4
+ export const tools = {
5
+ tools:
6
+ 'M14.7 6.3C14.319 6.689 14.319 7.311 14.7 7.7L16.3 9.3C16.689 9.681 17.311 9.681 17.7 9.3L21.47 5.53C22.5 7.805 22.012 10.48 20.246 12.246C18.48 14.012 15.805 14.5 13.53 13.47L6.62 20.38C5.792 21.208 4.448 21.208 3.62 20.38C2.792 19.552 2.792 18.208 3.62 17.38L10.53 10.47C9.5 8.195 9.988 5.52 11.754 3.754C13.52 1.988 16.195 1.5 18.47 2.53L14.71 6.29Z',
7
+ };
@@ -0,0 +1,18 @@
1
+ import { createSignal, storage } from 'lupine.native.core';
2
+
3
+ /** tabs: a tab bar on phones, a column on wide windows. sidemenu: a menu button and a drawer on phones, a column on wide windows. */
4
+ export type Layout = 'tabs' | 'sidemenu';
5
+
6
+ const saved = storage.get('layout');
7
+ const [chosen, setChosen] = createSignal<Layout | null>(saved === 'tabs' || saved === 'sidemenu' ? saved : null);
8
+ let fallback: Layout = 'tabs';
9
+
10
+ /** DEFAULT_LAYOUT of app.tsx, before the app is rendered */
11
+ export const setDefaultLayout = (l: Layout) => void (fallback = l);
12
+ /** what Settings chose, else the default (the server renders the default: it is kept on the device, not in a cookie) */
13
+ export const layout = (): Layout => chosen() || fallback;
14
+ /** null: the default again */
15
+ export const setLayout = (l: Layout | null) => {
16
+ setChosen(l);
17
+ storage.set('layout', l);
18
+ };
@@ -0,0 +1,89 @@
1
+ export const zhCN = {
2
+ app: { name: '我的笔记' },
3
+ nav: { notes: '笔记', finance: '财务', about: '关于', tools: '工具', mine: '我的', settings: '设置' },
4
+ menu: { dark: '深色模式', light: '浅色模式', footer: '基于 Lupine.js' },
5
+ notes: { empty: '还没有笔记', new: '新建笔记', edit: '编辑', confirmDelete: '删除这条笔记吗?', deleted: '笔记已删除' },
6
+ edit: {
7
+ new: '新建笔记',
8
+ edit: '编辑笔记',
9
+ save: '保存',
10
+ title: '标题',
11
+ titlePlaceholder: '标题…',
12
+ color: '颜色标记',
13
+ content: '内容',
14
+ contentPlaceholder: '写点什么…',
15
+ needTitle: '请输入标题',
16
+ added: '笔记已添加',
17
+ saved: '已保存',
18
+ },
19
+ detail: { title: '详情', missing: '没有这条笔记' },
20
+ search: { placeholder: '搜索标题和内容…', none: '没有找到笔记', hint: '搜索笔记的标题和内容', history: '最近搜索', clearHistory: '清除记录' },
21
+ finance: {
22
+ balance: '本月结余',
23
+ income: '收入',
24
+ spent: '支出',
25
+ entries: '本月',
26
+ salary: '工资',
27
+ rent: '房租',
28
+ groceries: '日用品',
29
+ freelance: '兼职收入',
30
+ power: '电费',
31
+ sample: '示例数据:在 app/src/pages/finance.tsx 中替换',
32
+ },
33
+ tools: {
34
+ stopwatch: '秒表',
35
+ stopwatchText: '开始、暂停、重置',
36
+ calendar: '日历',
37
+ calendarText: '距今天的天数',
38
+ colors: '颜色',
39
+ colorsText: '选择并复制颜色',
40
+ start: '开始',
41
+ pause: '暂停',
42
+ reset: '重置',
43
+ today: '今天',
44
+ inDays: '{n} 天后',
45
+ daysAgo: '{n} 天前',
46
+ },
47
+ mine: {
48
+ user: '演示用户',
49
+ tagline: '本地工作区,离线',
50
+ overview: '数据概览',
51
+ searches: '搜索',
52
+ premium: '升级到高级版',
53
+ premiumText: '解锁云同步、自定义主题和无限存储。',
54
+ plans: '查看方案',
55
+ },
56
+ premium: {
57
+ title: '高级版',
58
+ heading: '高级功能',
59
+ sub: '释放全部潜力',
60
+ text: '这是 Lupine.js 的演示应用。如果需要定制功能或高级功能,请在 GitHub 上提交 issue。',
61
+ request: '申请定制功能',
62
+ },
63
+ settings: {
64
+ appearance: '外观',
65
+ theme: '主题',
66
+ language: '语言',
67
+ layout: '菜单',
68
+ tabs: '底部标签',
69
+ sidemenu: '侧边菜单',
70
+ ocean: '海洋',
71
+ sand: '沙滩',
72
+ application: '应用',
73
+ feedback: '反馈与支持',
74
+ clearCache: '清除临时缓存',
75
+ cacheCleared: '缓存已清除',
76
+ version: '版本',
77
+ danger: '危险操作',
78
+ clearAll: '清除全部数据',
79
+ clearAllText: '这台设备上的所有笔记和搜索记录都会被删除,且无法恢复。',
80
+ erase: '全部清除',
81
+ cleared: '全部数据已清除',
82
+ },
83
+ about: {
84
+ version: '版本',
85
+ text: '全栈框架 Lupine.js 的演示应用:一套代码支持 iOS、Android、macOS、Windows 和网页。借助这个模板和 AI,可以快速构建并发布全平台应用。',
86
+ more: '了解更多',
87
+ },
88
+ notFound: { title: '页面不存在' },
89
+ };
@@ -0,0 +1,81 @@
1
+ import { createSignal, insets, MaybeSignal, media, ScrollView, Show, Text, View } from 'lupine.native.core';
2
+ import { col, Icon, IconButton, IconName, Line, router, setThemePref, SideMenu, Str, t, theme, tr } from 'lupine.native.components';
3
+ import * as icons from 'lupine.core/icons';
4
+ import { layout } from './layout';
5
+ import { navItems } from './nav';
6
+
7
+ const [open, setOpen] = createSignal(false);
8
+
9
+ /** The menu button in the headers of the tabs: phones only (by css on the web, so the page of the server is right). */
10
+ export const MenuButton = () => (
11
+ <View style={{ display: media<'flex' | 'none'>({ base: 'flex', mobileAbove: 'none' }) }}>
12
+ <IconButton name={icons.menu} color={col('headerText')} onPress={() => setOpen(true)} testID='menu-button' />
13
+ </View>
14
+ );
15
+
16
+ /** The name of the app at the top of the menus. */
17
+ export const Brand = () => (
18
+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: 10, padding: 16 }}>
19
+ <View style={{ width: 32, height: 32, borderRadius: 8, alignItems: 'center', justifyContent: 'center', backgroundColor: col('primary') }}>
20
+ <Icon name={icons.file} size={18} color={col('onPrimary')} />
21
+ </View>
22
+ <Text numberOfLines={1} style={{ flex: 1, fontSize: 17, fontWeight: '700', color: col('text') }}>{tr('app.name', 'My Note App')}</Text>
23
+ </View>
24
+ );
25
+
26
+ const Item = (p: { label: Str; icon: MaybeSignal<IconName>; active?: () => boolean; onPress: () => void; testID: string }) => {
27
+ const on = () => !!p.active?.();
28
+ const color = () => theme().c[on() ? 'primary' : 'sidebarText'];
29
+ return (
30
+ <View
31
+ testID={p.testID} onPress={p.onPress}
32
+ style={{ flexDirection: 'row', alignItems: 'center', gap: 12, height: 42, marginHorizontal: 8, paddingHorizontal: 10, borderRadius: 8, backgroundColor: () => (on() ? theme().c.selected : 'transparent') }}
33
+ >
34
+ <Icon name={p.icon} size={20} color={color} />
35
+ <Text numberOfLines={1} style={{ flex: 1, fontSize: 15, color }}>{p.label}</Text>
36
+ </View>
37
+ );
38
+ };
39
+
40
+ /**
41
+ * The side menu: in the drawer of phones (prefix menu) and, with the layout sidemenu, the column of wide windows
42
+ * (prefix side). nav: with the tabs. onGo: the drawer closes first.
43
+ */
44
+ export const MenuContent = (p: { prefix: string; nav: () => boolean; onGo?: () => void }) => {
45
+ const go = (path: string, push = false) => {
46
+ const open = () => (push ? router.push(path) : router.navigate(path));
47
+ if (!p.onGo) return open();
48
+ p.onGo();
49
+ setTimeout(open, 120);
50
+ };
51
+ const dark = () => theme().mode === 'dark';
52
+ return (
53
+ <View style={{ flex: 1 }}>
54
+ <Brand />
55
+ <Line />
56
+ <ScrollView style={{ flex: 1 }}>
57
+ <View style={{ paddingVertical: 8, gap: 2 }}>
58
+ <Show when={p.nav}>
59
+ {navItems.map((item) => (
60
+ <Item label={item.label} icon={item.icon} active={() => router.tab() === item.key} onPress={() => go(item.key)} testID={`${p.prefix}-${item.testID.slice(4)}`} />
61
+ ))}
62
+ <Line style={{ marginVertical: 8, marginHorizontal: 16 }} />
63
+ </Show>
64
+ <Item
65
+ label={() => (dark() ? t('menu.light', 'Light mode') : t('menu.dark', 'Dark mode'))} icon={() => (dark() ? icons.sun : icons.moon)}
66
+ onPress={() => setThemePref(dark() ? 'light' : 'dark')} testID={`${p.prefix}-theme`}
67
+ />
68
+ <Item label={tr('nav.settings', 'Settings')} icon={icons.settings} onPress={() => go('/settings', true)} testID={`${p.prefix}-settings`} />
69
+ </View>
70
+ </ScrollView>
71
+ <Text style={{ textAlign: 'center', fontSize: 12, color: col('textTertiary'), paddingTop: 12, paddingBottom: () => 12 + insets().bottom }}>{tr('menu.footer', 'Powered by Lupine.js')}</Text>
72
+ </View>
73
+ );
74
+ };
75
+
76
+ /** The drawer of phones; with the layout sidemenu it has the tabs, too. */
77
+ export const AppMenu = () => (
78
+ <SideMenu visible={open} onClose={() => setOpen(false)} testID='side-menu'>
79
+ <MenuContent prefix='menu' nav={() => layout() === 'sidemenu'} onGo={() => setOpen(false)} />
80
+ </SideMenu>
81
+ );
@@ -0,0 +1,12 @@
1
+ import { NavItem, tr } from 'lupine.native.components';
2
+ import * as icons from 'lupine.core/icons';
3
+ import { finance, tools } from './icons';
4
+
5
+ /** The tabs, in the tab bar and in the side menu. key: the path of the tab. */
6
+ export const navItems: NavItem[] = [
7
+ { key: '/', label: tr('nav.notes', 'Notes'), icon: icons.file, testID: 'tab-notes' },
8
+ { key: '/finance', label: tr('nav.finance', 'Finance'), icon: finance, testID: 'tab-finance' },
9
+ { key: '/about', label: tr('nav.about', 'About'), icon: icons.info, raised: true, testID: 'tab-about' },
10
+ { key: '/tools', label: tr('nav.tools', 'Tools'), icon: tools, testID: 'tab-tools' },
11
+ { key: '/mine', label: tr('nav.mine', 'Mine'), icon: icons.user, testID: 'tab-mine' },
12
+ ];
@@ -0,0 +1,72 @@
1
+ import { createSignal, storage } from 'lupine.native.core';
2
+
3
+ // What the app keeps on the device (on the web: in the browser). storage is for small values; a big app would keep its
4
+ // notes in files (lupine.native.core: writeFile) or on a server (fetch).
5
+
6
+ export interface Note {
7
+ id: number;
8
+ title: string;
9
+ content: string;
10
+ /** '' or '#e53935' */
11
+ color: string;
12
+ updatedAt: number;
13
+ }
14
+
15
+ const read = <T>(key: string, fallback: T): T => {
16
+ try {
17
+ return (JSON.parse(storage.get(key) || 'null') as T) ?? fallback;
18
+ } catch {
19
+ return fallback;
20
+ }
21
+ };
22
+
23
+ const [list, setList] = createSignal<Note[]>(read<Note[]>('notes', []));
24
+ const keep = (next: Note[]) => {
25
+ setList(next);
26
+ storage.set('notes', JSON.stringify(next));
27
+ };
28
+
29
+ /** The notes, the newest (or the one dragged up) first. Changed notes are new objects, the others stay: lists keep their rows. */
30
+ export const notes = {
31
+ list,
32
+ get: (id: number) => list().find((n) => n.id === id),
33
+ /** a new one without id; returns its id */
34
+ save: (note: { id?: number; title: string; content: string; color: string }): number => {
35
+ const now = Date.now();
36
+ if (note.id) {
37
+ keep(list().map((n) => (n.id === note.id ? { ...n, ...note, id: n.id, updatedAt: now } : n)));
38
+ return note.id;
39
+ }
40
+ const id = list().reduce((max, n) => Math.max(max, n.id + 1), now);
41
+ keep([{ id, title: note.title, content: note.content, color: note.color, updatedAt: now }, ...list()]);
42
+ return id;
43
+ },
44
+ remove: (id: number) => keep(list().filter((n) => n.id !== id)),
45
+ /** after dragging */
46
+ reorder: (next: Note[]) => keep(next),
47
+ search: (query: string) => {
48
+ const q = query.trim().toLowerCase();
49
+ return q ? list().filter((n) => n.title.toLowerCase().includes(q) || n.content.toLowerCase().includes(q)) : [];
50
+ },
51
+ };
52
+
53
+ const [history, setHistory] = createSignal<string[]>(read<string[]>('search-history', []));
54
+ const keepHistory = (next: string[]) => {
55
+ setHistory(next);
56
+ storage.set('search-history', next.length ? JSON.stringify(next) : null);
57
+ };
58
+
59
+ /** What was searched for, the last one first. */
60
+ export const searchHistory = {
61
+ list: history,
62
+ add: (query: string) => {
63
+ const q = query.trim();
64
+ if (q) keepHistory([q, ...history().filter((h) => h !== q)].slice(0, 10));
65
+ },
66
+ clear: () => keepHistory([]),
67
+ };
68
+
69
+ export const clearAllData = () => {
70
+ keep([]);
71
+ keepHistory([]);
72
+ };
@@ -0,0 +1,11 @@
1
+ import { addLnTexts, addTexts, lnZhHans, setLanguages } from 'lupine.native.components';
2
+ import { zhCN } from './locales/zh-CN';
3
+
4
+ // English is in the code: t('notes.empty', 'No notes yet'); here the other languages
5
+ addTexts('zh-CN', zhCN);
6
+ // and those of the controls (OK, Cancel, the months ...)
7
+ addLnTexts({ 'zh-Hans': lnZhHans });
8
+ setLanguages([
9
+ { code: 'en', name: 'English' },
10
+ { code: 'zh-CN', name: '简体中文' },
11
+ ]);
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2020",
4
+ "lib": ["es2020"],
5
+ "types": [],
6
+ "jsx": "react-jsx",
7
+ "jsxImportSource": "lupine.native.core",
8
+ "module": "esnext",
9
+ "moduleResolution": "bundler",
10
+ "strict": true,
11
+ "noEmit": true,
12
+ "skipLibCheck": true
13
+ },
14
+ // the web entry is the only file that may use the DOM, so it isn't checked with these settings
15
+ "include": ["src"],
16
+ "exclude": ["src/index.web.tsx"]
17
+ }
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "name": "lupine-template-responsive-starter",
3
+ "nativeOut": "dist/native",
4
+ "nativeApp": "app",
3
5
  "webEntryPoints": [
4
6
  {
5
7
  "index": "web/src/index.tsx",
@@ -12,7 +14,6 @@
12
14
  "outdir": "/lupine-template-responsive-starter"
13
15
  }
14
16
  ],
15
- "apiEntryPoint": "api/src/index.ts",
16
17
  "copyFiles": [
17
18
  {
18
19
  "env": "all",
@@ -21,13 +22,13 @@
21
22
  },
22
23
  {
23
24
  "env": "all",
24
- "from": "web/src/lupine-template-responsive-starter/404.html",
25
- "to": "web/lupine-template-responsive-starter/404.html"
25
+ "from": "web/src/lupine-template-responsive-starter/assets",
26
+ "to": "web/lupine-template-responsive-starter/assets"
26
27
  },
27
28
  {
28
29
  "env": "all",
29
- "from": "api/resources",
30
- "to": "data/resources"
30
+ "from": "web/src/lupine-template-responsive-starter/404.html",
31
+ "to": "web/lupine-template-responsive-starter/404.html"
31
32
  }
32
33
  ]
33
- }
34
+ }
@@ -3,11 +3,18 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <title><!--META-TITLE--></title>
6
- <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, user-scalable=no" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
7
7
  <!--META-ENV-START-->
8
8
  <!--META-ENV-END-->
9
9
  <link rel="shortcut icon" href="{SUBDIR}/assets/favicon.ico?t={hash}" type="image/x-icon" />
10
- <link rel="stylesheet" type="text/css" href="{SUBDIR}/index.css?t={hash}" />
10
+ <style>
11
+ html,
12
+ body,
13
+ .lupine-root {
14
+ height: 100%;
15
+ margin: 0;
16
+ }
17
+ </style>
11
18
  <script defer src="{SUBDIR}/index.js?t={hash}"></script>
12
19
  </head>
13
20
  <body>