create-lupine 1.2.0 → 1.3.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 (268) hide show
  1. package/README.md +13 -7
  2. package/index.js +236 -109
  3. package/package.json +1 -1
  4. package/templates/common/.agents/skills/lupine-framework/SKILL.md +3 -3
  5. package/templates/common/.agents/skills/lupine-framework/references/backend-api.md +16 -1
  6. package/templates/common/.agents/skills/lupine-framework/references/icon-handling.md +1 -1
  7. package/templates/common/.agents/skills/lupine-framework/references/mobile-interactions.md +17 -88
  8. package/templates/common/.agents/skills/lupine-framework/references/native-apps.md +47 -24
  9. package/templates/common/.agents/skills/lupine-framework/references/navigation-and-routing.md +1 -0
  10. package/templates/common/.agents/skills/lupine-framework/references/reactivity-and-state.md +2 -2
  11. package/templates/common/.agents/skills/lupine-framework/references/styling-and-themes.md +3 -1
  12. package/templates/common/.env.development +2 -0
  13. package/templates/common/.env.mobile +4 -3
  14. package/templates/common/_env +10 -5
  15. package/templates/common/apps/server/README.md +10 -0
  16. package/templates/common/dev/cp-folder.js +9 -4
  17. package/templates/lupine-template-cv-starter/README.md +33 -1
  18. package/templates/lupine-template-cv-starter/app/package.json +20 -0
  19. package/templates/lupine-template-cv-starter/app/src/app.tsx +6 -0
  20. package/templates/lupine-template-cv-starter/app/src/index.native.tsx +4 -0
  21. package/templates/lupine-template-cv-starter/app/src/index.test.tsx +71 -0
  22. package/templates/lupine-template-cv-starter/app/src/index.web.tsx +28 -0
  23. package/templates/lupine-template-cv-starter/app/tsconfig.json +17 -0
  24. package/templates/lupine-template-cv-starter/lupine.json +8 -7
  25. package/templates/lupine-template-cv-starter/web/src/index.html +9 -2
  26. package/templates/lupine-template-cv-starter/web/src/index.tsx +9 -14
  27. package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.html +9 -2
  28. package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.tsx +4 -20
  29. package/templates/lupine-template-doc-starter/README.md +33 -1
  30. package/templates/lupine-template-doc-starter/app/package.json +20 -0
  31. package/templates/lupine-template-doc-starter/app/src/app.tsx +6 -0
  32. package/templates/lupine-template-doc-starter/app/src/index.native.tsx +4 -0
  33. package/templates/lupine-template-doc-starter/app/src/index.test.tsx +78 -0
  34. package/templates/lupine-template-doc-starter/app/src/index.web.tsx +28 -0
  35. package/templates/lupine-template-doc-starter/app/tsconfig.json +17 -0
  36. package/templates/lupine-template-doc-starter/lupine.json +8 -7
  37. package/templates/lupine-template-doc-starter/web/src/index.html +9 -2
  38. package/templates/lupine-template-doc-starter/web/src/index.tsx +9 -14
  39. package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.html +9 -2
  40. package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.tsx +4 -20
  41. package/templates/lupine-template-fullstack-note/README.md +83 -0
  42. package/templates/{lupine-template-cv-starter → lupine-template-fullstack-note}/api/package.json +2 -2
  43. package/templates/lupine-template-fullstack-note/api/resources/install.mysql.sql +32 -0
  44. package/templates/lupine-template-fullstack-note/api/resources/install.sqlite.sql +27 -0
  45. package/templates/lupine-template-fullstack-note/api/src/service/answer.ts +39 -0
  46. package/templates/lupine-template-fullstack-note/api/src/service/api.ts +52 -0
  47. package/templates/lupine-template-fullstack-note/api/src/service/db.ts +78 -0
  48. package/templates/lupine-template-fullstack-note/api/src/service/notes-api.ts +86 -0
  49. package/templates/lupine-template-fullstack-note/api/src/service/root-api.ts +19 -0
  50. package/templates/lupine-template-fullstack-note/api/src/service/user-api.ts +182 -0
  51. package/templates/lupine-template-fullstack-note/app/package.json +19 -0
  52. package/templates/lupine-template-fullstack-note/app/src/app.tsx +75 -0
  53. package/templates/lupine-template-fullstack-note/app/src/index.native.tsx +4 -0
  54. package/templates/lupine-template-fullstack-note/app/src/index.test.tsx +373 -0
  55. package/templates/lupine-template-fullstack-note/app/src/index.web.tsx +20 -0
  56. package/templates/lupine-template-fullstack-note/app/src/pages/components.tsx +65 -0
  57. package/templates/lupine-template-fullstack-note/app/src/pages/details.tsx +38 -0
  58. package/templates/lupine-template-fullstack-note/app/src/pages/discover.tsx +25 -0
  59. package/templates/lupine-template-fullstack-note/app/src/pages/home.tsx +76 -0
  60. package/templates/lupine-template-fullstack-note/app/src/pages/inbox.tsx +49 -0
  61. package/templates/lupine-template-fullstack-note/app/src/pages/login.tsx +54 -0
  62. package/templates/lupine-template-fullstack-note/app/src/pages/me.tsx +32 -0
  63. package/templates/lupine-template-fullstack-note/app/src/pages/notes.tsx +128 -0
  64. package/templates/lupine-template-fullstack-note/app/src/pages/settings.tsx +45 -0
  65. package/templates/lupine-template-fullstack-note/app/src/shell/AppMenu.tsx +44 -0
  66. package/templates/lupine-template-fullstack-note/app/src/shell/api.ts +159 -0
  67. package/templates/lupine-template-fullstack-note/app/src/shell/data.ts +20 -0
  68. package/templates/lupine-template-fullstack-note/app/src/shell/locales/ja.ts +80 -0
  69. package/templates/lupine-template-fullstack-note/app/src/shell/locales/zh-CN.ts +80 -0
  70. package/templates/lupine-template-fullstack-note/app/src/shell/texts.ts +14 -0
  71. package/templates/lupine-template-fullstack-note/app/tsconfig.json +17 -0
  72. package/templates/lupine-template-fullstack-note/lupine.json +25 -0
  73. package/templates/lupine-template-fullstack-note/web/assets/favicon.ico +0 -0
  74. package/templates/{lupine-template-doc-starter/api → lupine-template-fullstack-note/web}/package.json +2 -2
  75. package/templates/lupine-template-fullstack-note/web/src/index.html +23 -0
  76. package/templates/lupine-template-fullstack-note/web/src/index.tsx +15 -0
  77. package/templates/lupine-template-fullstack-starter/README.md +64 -14
  78. package/templates/lupine-template-fullstack-starter/api/resources/install.mysql.sql +2 -2
  79. package/templates/lupine-template-fullstack-starter/api/resources/install.sqlite.sql +2 -2
  80. package/templates/lupine-template-fullstack-starter/api/src/service/contact-api.ts +2 -2
  81. package/templates/lupine-template-fullstack-starter/api/src/service/user-api.ts +72 -47
  82. package/templates/lupine-template-fullstack-starter/app/package.json +20 -0
  83. package/templates/lupine-template-fullstack-starter/app/src/app.tsx +76 -0
  84. package/templates/lupine-template-fullstack-starter/app/src/index.native.tsx +4 -0
  85. package/templates/lupine-template-fullstack-starter/app/src/index.test.tsx +276 -0
  86. package/templates/lupine-template-fullstack-starter/app/src/index.web.tsx +28 -0
  87. package/templates/lupine-template-fullstack-starter/app/src/pages/about.tsx +27 -0
  88. package/templates/lupine-template-fullstack-starter/app/src/pages/contact.tsx +41 -0
  89. package/templates/lupine-template-fullstack-starter/app/src/pages/favorite.tsx +27 -0
  90. package/templates/lupine-template-fullstack-starter/app/src/pages/home.tsx +63 -0
  91. package/templates/lupine-template-fullstack-starter/app/src/pages/login.tsx +63 -0
  92. package/templates/lupine-template-fullstack-starter/app/src/pages/mine.tsx +44 -0
  93. package/templates/lupine-template-fullstack-starter/app/src/pages/profile.tsx +58 -0
  94. package/templates/lupine-template-fullstack-starter/app/src/pages/register.tsx +48 -0
  95. package/templates/lupine-template-fullstack-starter/app/src/pages/reset-password.tsx +41 -0
  96. package/templates/lupine-template-fullstack-starter/app/src/pages/settings.tsx +33 -0
  97. package/templates/lupine-template-fullstack-starter/app/src/pages/story.tsx +46 -0
  98. package/templates/lupine-template-fullstack-starter/app/src/shell/api.ts +127 -0
  99. package/templates/lupine-template-fullstack-starter/app/src/shell/parts.tsx +100 -0
  100. package/templates/lupine-template-fullstack-starter/app/src/shell/stories.ts +65 -0
  101. package/templates/lupine-template-fullstack-starter/app/src/shell/texts.ts +79 -0
  102. package/templates/lupine-template-fullstack-starter/app/tsconfig.json +17 -0
  103. package/templates/lupine-template-fullstack-starter/lupine.json +6 -7
  104. package/templates/lupine-template-fullstack-starter/web/src/admin/admin-patch.tsx +34 -0
  105. package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/home-search-component.tsx +18 -25
  106. package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/story-card.tsx +17 -8
  107. package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/story-list.tsx +1 -2
  108. package/templates/lupine-template-fullstack-starter/web/src/{admin_dev → admin}/index.html +1 -0
  109. package/templates/lupine-template-fullstack-starter/web/src/{admin_dev → admin}/index.tsx +13 -28
  110. package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-cfg.tsx +23 -19
  111. package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-item-edit.tsx +3 -4
  112. package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-item-list.tsx +2 -3
  113. package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-user.tsx +15 -20
  114. package/templates/lupine-template-fullstack-starter/web/src/index.html +8 -2
  115. package/templates/lupine-template-fullstack-starter/web/src/index.tsx +11 -150
  116. package/templates/lupine-template-fullstack-starter/web/src/services/fetch-data.ts +7 -25
  117. package/templates/lupine-template-fullstack-starter/web/src/styles/base-css.ts +0 -3
  118. package/templates/lupine-template-fullstack-starter/web/src/styles/theme.ts +1 -2
  119. package/templates/lupine-template-responsive-starter/README.md +46 -2
  120. package/templates/lupine-template-responsive-starter/app/package.json +19 -0
  121. package/templates/lupine-template-responsive-starter/app/src/app.tsx +80 -0
  122. package/templates/lupine-template-responsive-starter/app/src/index.native.tsx +4 -0
  123. package/templates/lupine-template-responsive-starter/app/src/index.test.tsx +283 -0
  124. package/templates/lupine-template-responsive-starter/app/src/index.web.tsx +31 -0
  125. package/templates/lupine-template-responsive-starter/app/src/pages/about.tsx +23 -0
  126. package/templates/lupine-template-responsive-starter/app/src/pages/finance.tsx +48 -0
  127. package/templates/lupine-template-responsive-starter/app/src/pages/mine.tsx +60 -0
  128. package/templates/lupine-template-responsive-starter/app/src/pages/not-found.tsx +9 -0
  129. package/templates/lupine-template-responsive-starter/app/src/pages/note-detail.tsx +43 -0
  130. package/templates/lupine-template-responsive-starter/app/src/pages/note-edit.tsx +45 -0
  131. package/templates/lupine-template-responsive-starter/app/src/pages/note-search.tsx +62 -0
  132. package/templates/lupine-template-responsive-starter/app/src/pages/notes.tsx +71 -0
  133. package/templates/lupine-template-responsive-starter/app/src/pages/settings.tsx +55 -0
  134. package/templates/lupine-template-responsive-starter/app/src/pages/tools.tsx +112 -0
  135. package/templates/lupine-template-responsive-starter/app/src/shell/icons.ts +7 -0
  136. package/templates/lupine-template-responsive-starter/app/src/shell/layout.ts +18 -0
  137. package/templates/lupine-template-responsive-starter/app/src/shell/locales/zh-CN.ts +89 -0
  138. package/templates/lupine-template-responsive-starter/app/src/shell/menu.tsx +81 -0
  139. package/templates/lupine-template-responsive-starter/app/src/shell/nav.ts +12 -0
  140. package/templates/lupine-template-responsive-starter/app/src/shell/store.ts +72 -0
  141. package/templates/lupine-template-responsive-starter/app/src/shell/texts.ts +11 -0
  142. package/templates/lupine-template-responsive-starter/app/tsconfig.json +17 -0
  143. package/templates/lupine-template-responsive-starter/lupine.json +7 -6
  144. package/templates/lupine-template-responsive-starter/web/src/index.html +9 -2
  145. package/templates/lupine-template-responsive-starter/web/src/index.tsx +9 -25
  146. package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.html +12 -6
  147. package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.tsx +12 -22
  148. package/templates/common/apps/server/src/app-loader.ts +0 -4
  149. package/templates/lupine-template-cv-starter/api/resources/config_default.json +0 -6
  150. package/templates/lupine-template-cv-starter/api/resources/install.sqlite.sql +0 -4
  151. package/templates/lupine-template-cv-starter/api/src/index.ts +0 -15
  152. package/templates/lupine-template-cv-starter/web/src/client-env-keys.ts +0 -5
  153. package/templates/lupine-template-cv-starter/web/src/styles/base-css.ts +0 -15
  154. package/templates/lupine-template-doc-starter/api/resources/config_default.json +0 -6
  155. package/templates/lupine-template-doc-starter/api/resources/install.sqlite.sql +0 -4
  156. package/templates/lupine-template-doc-starter/api/src/index.ts +0 -15
  157. package/templates/lupine-template-doc-starter/api/src/resources/config_default.json +0 -6
  158. package/templates/lupine-template-doc-starter/api/src/resources/install.sqlite.sql +0 -4
  159. package/templates/lupine-template-doc-starter/web/src/client-env-keys.ts +0 -5
  160. package/templates/lupine-template-doc-starter/web/src/styles/base-css.ts +0 -15
  161. package/templates/lupine-template-fullstack-starter/web/src/admin_dev/admin-about.tsx +0 -16
  162. package/templates/lupine-template-fullstack-starter/web/src/admin_dev/admin-patch.ts +0 -22
  163. package/templates/lupine-template-fullstack-starter/web/src/components/footer-menu.tsx +0 -52
  164. package/templates/lupine-template-fullstack-starter/web/src/components/footer.tsx +0 -15
  165. package/templates/lupine-template-fullstack-starter/web/src/components/header.tsx +0 -75
  166. package/templates/lupine-template-fullstack-starter/web/src/components/login-code-zh.tsx +0 -162
  167. package/templates/lupine-template-fullstack-starter/web/src/components/login-code.tsx +0 -165
  168. package/templates/lupine-template-fullstack-starter/web/src/components/login-zh.tsx +0 -118
  169. package/templates/lupine-template-fullstack-starter/web/src/components/login.tsx +0 -122
  170. package/templates/lupine-template-fullstack-starter/web/src/components/not-found-page.tsx +0 -12
  171. package/templates/lupine-template-fullstack-starter/web/src/components/register-zh.tsx +0 -161
  172. package/templates/lupine-template-fullstack-starter/web/src/components/register.tsx +0 -163
  173. package/templates/lupine-template-fullstack-starter/web/src/components/reset-password-zh.tsx +0 -166
  174. package/templates/lupine-template-fullstack-starter/web/src/components/reset-password.tsx +0 -177
  175. package/templates/lupine-template-fullstack-starter/web/src/components/user-info.tsx +0 -84
  176. package/templates/lupine-template-fullstack-starter/web/src/frames/admin-page-frame.tsx +0 -48
  177. package/templates/lupine-template-fullstack-starter/web/src/frames/frame1-page-frame.tsx +0 -61
  178. package/templates/lupine-template-fullstack-starter/web/src/frames/frame2-page-frame.tsx +0 -61
  179. package/templates/lupine-template-fullstack-starter/web/src/frames/top-frame.tsx +0 -23
  180. package/templates/lupine-template-fullstack-starter/web/src/frames/user-page-frame.tsx +0 -90
  181. package/templates/lupine-template-fullstack-starter/web/src/models/index.ts +0 -15
  182. package/templates/lupine-template-fullstack-starter/web/src/pages/contact.tsx +0 -105
  183. package/templates/lupine-template-fullstack-starter/web/src/pages/page1-page.tsx +0 -38
  184. package/templates/lupine-template-fullstack-starter/web/src/pages/page2-page.tsx +0 -38
  185. package/templates/lupine-template-fullstack-starter/web/src/pages/user-favorite-page.tsx +0 -58
  186. package/templates/lupine-template-fullstack-starter/web/src/pages/user-home-page.tsx +0 -27
  187. package/templates/lupine-template-fullstack-starter/web/src/pages/user-mine-page.tsx +0 -54
  188. package/templates/lupine-template-fullstack-starter/web/src/pages/user-profile-page-zh.tsx +0 -112
  189. package/templates/lupine-template-fullstack-starter/web/src/pages/user-profile-page.tsx +0 -112
  190. package/templates/lupine-template-fullstack-starter/web/src/pages/user1-page.tsx +0 -57
  191. package/templates/lupine-template-fullstack-starter/web/src/services/shared-data.ts +0 -19
  192. package/templates/lupine-template-fullstack-starter/web/src/styles/app.css +0 -0
  193. package/templates/lupine-template-responsive-starter/api/package.json +0 -6
  194. package/templates/lupine-template-responsive-starter/api/resources/config_default.json +0 -6
  195. package/templates/lupine-template-responsive-starter/api/resources/install.sqlite.sql +0 -4
  196. package/templates/lupine-template-responsive-starter/api/src/service/root-api.ts +0 -18
  197. package/templates/lupine-template-responsive-starter/web/src/app-icons.ts +0 -76
  198. package/templates/lupine-template-responsive-starter/web/src/components/input-history-component.tsx +0 -93
  199. package/templates/lupine-template-responsive-starter/web/src/components/mine-about-page.tsx +0 -87
  200. package/templates/lupine-template-responsive-starter/web/src/components/mine-premium-page.tsx +0 -81
  201. package/templates/lupine-template-responsive-starter/web/src/components/mine-settings-page.tsx +0 -211
  202. package/templates/lupine-template-responsive-starter/web/src/components/mobile-top-search-menu.tsx +0 -107
  203. package/templates/lupine-template-responsive-starter/web/src/components/note-detail.tsx +0 -110
  204. package/templates/lupine-template-responsive-starter/web/src/components/note-edit.tsx +0 -144
  205. package/templates/lupine-template-responsive-starter/web/src/components/note-search-page.tsx +0 -188
  206. package/templates/lupine-template-responsive-starter/web/src/components/search-input.tsx +0 -95
  207. package/templates/lupine-template-responsive-starter/web/src/components/side-menu-content.tsx +0 -169
  208. package/templates/lupine-template-responsive-starter/web/src/frames/app-responsive-frame.tsx +0 -53
  209. package/templates/lupine-template-responsive-starter/web/src/pages/about-page.tsx +0 -32
  210. package/templates/lupine-template-responsive-starter/web/src/pages/finance-page.tsx +0 -35
  211. package/templates/lupine-template-responsive-starter/web/src/pages/home-page.tsx +0 -444
  212. package/templates/lupine-template-responsive-starter/web/src/pages/mine-page.tsx +0 -318
  213. package/templates/lupine-template-responsive-starter/web/src/pages/tools-page.tsx +0 -35
  214. package/templates/lupine-template-responsive-starter/web/src/services/local-notes-service.ts +0 -87
  215. package/templates/lupine-template-responsive-starter/web/src/services/mine-service.ts +0 -45
  216. package/templates/lupine-template-responsive-starter/web/src/styles/app.css +0 -0
  217. package/templates/lupine-template-responsive-starter/web/src/styles/base-css.ts +0 -65
  218. package/templates/lupine-template-responsive-starter/web/src/styles/global.css +0 -2130
  219. package/templates/lupine-template-responsive-starter/web/src/styles/theme.ts +0 -17
  220. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/01-experience/index.md +0 -0
  221. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/02-projects/index.md +0 -0
  222. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/03-skills/index.md +0 -0
  223. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/04-education/index.md +0 -0
  224. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/index.md +0 -0
  225. /package/templates/lupine-template-cv-starter/{web → app}/markdown/index.md +0 -0
  226. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/01-experience/index.md +0 -0
  227. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/02-projects/index.md +0 -0
  228. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/03-skills/index.md +0 -0
  229. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/04-education/index.md +0 -0
  230. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/index.md +0 -0
  231. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/01-experience/index.html +0 -0
  232. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/02-projects/index.html +0 -0
  233. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/03-skills/index.html +0 -0
  234. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/04-education/index.html +0 -0
  235. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/index.html +0 -0
  236. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/index.html +0 -0
  237. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
  238. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/01-experience/index.html +0 -0
  239. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/02-projects/index.html +0 -0
  240. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/03-skills/index.html +0 -0
  241. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/04-education/index.html +0 -0
  242. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
  243. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/index.md +0 -0
  244. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/list.md +0 -0
  245. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/install.md +0 -0
  246. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/started.md +0 -0
  247. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/index.md +0 -0
  248. /package/templates/lupine-template-doc-starter/{web → app}/markdown/index.md +0 -0
  249. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/index.md +0 -0
  250. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/list.md +0 -0
  251. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/install.md +0 -0
  252. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/started.md +0 -0
  253. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/index.md +0 -0
  254. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/index.html +0 -0
  255. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/list.html +0 -0
  256. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/install.html +0 -0
  257. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/started.html +0 -0
  258. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/index.html +0 -0
  259. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/index.html +0 -0
  260. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
  261. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/index.html +0 -0
  262. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/list.html +0 -0
  263. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/install.html +0 -0
  264. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/started.html +0 -0
  265. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
  266. /package/templates/{lupine-template-responsive-starter → lupine-template-fullstack-note}/api/src/index.ts +0 -0
  267. /package/templates/lupine-template-fullstack-starter/{web/assets/images → app/assets}/sample.png +0 -0
  268. /package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/story-props.ts +0 -0
@@ -1,54 +0,0 @@
1
- import { clearCookie, CssProps, getRenderPageProps, PageProps, refreshPage } from 'lupine.web';
2
- import { getCookieUser } from '../services/shared-data';
3
- import { userCookieName } from '../models';
4
-
5
- const fetchHomeData = async (props: PageProps) => {
6
- const data = await props.renderPageFunctions.fetchData('/api/settings');
7
- return data.json;
8
- };
9
-
10
- export const UserMinePage = async (props: PageProps) => {
11
- const css: CssProps = {
12
- display: 'flex',
13
- flexDirection: 'column',
14
- width: '100%',
15
- margin: '0 auto',
16
- '.mine-box': {
17
- padding: '16px',
18
- },
19
- '.login-links': {
20
- display: 'flex',
21
- padding: '16px',
22
- },
23
- };
24
-
25
- const onLogout = async () => {
26
- // DomUtils.clearCookie(tokenCookieName, '/');
27
- clearCookie(userCookieName, '/');
28
- // call server to clear cookie
29
- await getRenderPageProps().renderPageFunctions.fetchData('/api/logout', {});
30
- await refreshPage('/');
31
- };
32
- const userCookie = getCookieUser();
33
- return (
34
- <div css={css}>
35
- <div class='login-links'>
36
- <div>
37
- Hi, <a href='/user/profile'>{userCookie.u}</a>
38
- </div>
39
- <a class='ml-m' href='javascript:void()' onClick={onLogout}>
40
- Logout
41
- </a>
42
- {userCookie.t === 'admin' && (
43
- <a class='ml-m' href='/admin'>
44
- Admin
45
- </a>
46
- )}
47
- </div>
48
- <div class='mine-box'>
49
- <div class='page-title'>Mine page</div>
50
- <div class='a-text'>Mine page</div>
51
- </div>
52
- </div>
53
- );
54
- };
@@ -1,112 +0,0 @@
1
- import { createSignal, CssProps, getRenderPageProps, onMount, PageProps } from 'lupine.web';
2
- import { DomUtils, MediaQueryMaxWidth, NotificationMessage, NotificationColor } from 'lupine.web.components';
3
- import { getUserInfo, UserInfoType } from '../components/user-info';
4
-
5
- const PageContent = ({ user }: { user: UserInfoType }) => {
6
- const css: CssProps = {
7
- display: 'flex',
8
- flexDirection: 'column',
9
- width: '100%',
10
- maxWidth: MediaQueryMaxWidth.DesktopMax,
11
- margin: 'auto',
12
- '.label': {
13
- width: '200px',
14
- marginBottom: '20px',
15
- },
16
- '.m-menu': {
17
- display: 'flex',
18
- flexDirection: 'row',
19
- padding: '10px',
20
- border: '1px solid #aaa',
21
- borderRadius: '8px',
22
- margin: '10px 0',
23
- },
24
- '.m-label': {
25
- width: '200px',
26
- },
27
- '.m-text': {
28
- width: '400px',
29
- marginBottom: '10px',
30
- },
31
- 'textarea.m-text': {
32
- height: '80px',
33
- },
34
- };
35
-
36
- const onSave = async () => {
37
- const nickname = DomUtils.getValue('.f-nickname');
38
- const password = DomUtils.getValue('.f-password');
39
- const password2 = DomUtils.getValue('.f-password2');
40
- if (!nickname) {
41
- NotificationMessage.sendMessage('网名不能为空', NotificationColor.Error);
42
- return;
43
- }
44
- if (password && password !== password2) {
45
- NotificationMessage.sendMessage('两次输入的密码不一致', NotificationColor.Error);
46
- return;
47
- }
48
- if (password && password.length < 6) {
49
- NotificationMessage.sendMessage('密码长度不能小于6位', NotificationColor.Error);
50
- return;
51
- }
52
- const data: any = {
53
- nickname,
54
- password,
55
- };
56
-
57
- const result = await getRenderPageProps().renderPageFunctions.fetchData('/api/user-profile', JSON.stringify(data));
58
- console.log(result);
59
- NotificationMessage.sendMessage(result.json.message || '更新成功', NotificationColor.Success);
60
- setTimeout(() => {
61
- document.location.reload();
62
- }, 1000);
63
- };
64
- return (
65
- <div css={css}>
66
- <div class='row-box m-menu'>
67
- <span>Profile</span>
68
- </div>
69
- <div class='row-box'>
70
- <button class='button-base' onClick={onSave}>
71
- 更新
72
- </button>{' '}
73
- <div>(密码为空时将不更新密码)</div>
74
- </div>
75
- <div class='row-box mt-l'>
76
- <label class='m-label'>邮箱:</label> {user.email}
77
- </div>
78
- <div class='row-box mt-l'>
79
- <label class='m-label'>类型:</label> {user.usertype}
80
- </div>
81
- <hr />
82
- <div class='row-box'>
83
- <label class='m-label'>网名:</label>{' '}
84
- <input type='text' class='input-base m-text f-nickname' value={user.nickname} />
85
- </div>
86
- <div class='row-box'>
87
- <label class='m-label'>密码:</label> <input type='password' class='input-base m-text f-password' value='' />
88
- </div>
89
- <div class='row-box'>
90
- <label class='m-label'>确认密码:</label>{' '}
91
- <input type='password' class='input-base m-text f-password2' value='' />
92
- </div>
93
- </div>
94
- );
95
- };
96
-
97
- export const UserProfilePage = async (props: PageProps) => {
98
- onMount(async () => {
99
- const user = await getUserInfo();
100
- setDom(
101
- <div class='padding-block'>
102
- <PageContent user={user!}></PageContent>
103
- </div>
104
- );
105
- });
106
- const [dom, setDom] = createSignal<any>('Loading...');
107
- return (
108
- <div>
109
- <div>{dom}</div>
110
- </div>
111
- );
112
- };
@@ -1,112 +0,0 @@
1
- import { createSignal, CssProps, getRenderPageProps, onMount, PageProps } from 'lupine.web';
2
- import { DomUtils, MediaQueryMaxWidth, NotificationMessage, NotificationColor } from 'lupine.web.components';
3
- import { getUserInfo, UserInfoType } from '../components/user-info';
4
-
5
- const PageContent = ({ user }: { user: UserInfoType }) => {
6
- const css: CssProps = {
7
- display: 'flex',
8
- flexDirection: 'column',
9
- width: '100%',
10
- maxWidth: MediaQueryMaxWidth.DesktopMax,
11
- margin: 'auto',
12
- '.label': {
13
- width: '200px',
14
- marginBottom: '20px',
15
- },
16
- '.m-menu': {
17
- display: 'flex',
18
- flexDirection: 'row',
19
- padding: '10px',
20
- border: '1px solid #aaa',
21
- borderRadius: '8px',
22
- margin: '10px 0',
23
- },
24
- '.m-label': {
25
- width: '200px',
26
- },
27
- '.m-text': {
28
- // width: '400px',
29
- marginBottom: '10px',
30
- },
31
- 'textarea.m-text': {
32
- height: '80px',
33
- },
34
- };
35
-
36
- const onSave = async () => {
37
- const nickname = DomUtils.getValue('.f-nickname');
38
- const password = DomUtils.getValue('.f-password');
39
- const password2 = DomUtils.getValue('.f-password2');
40
- if (!nickname) {
41
- NotificationMessage.sendMessage("Prefer name can't be empty", NotificationColor.Error);
42
- return;
43
- }
44
- if (password && password !== password2) {
45
- NotificationMessage.sendMessage('The two passwords do not match', NotificationColor.Error);
46
- return;
47
- }
48
- if (password && password.length < 6) {
49
- NotificationMessage.sendMessage('Password length must be at least 6 characters', NotificationColor.Error);
50
- return;
51
- }
52
- const data: any = {
53
- nickname,
54
- password,
55
- };
56
-
57
- const result = await getRenderPageProps().renderPageFunctions.fetchData('/api/user-profile', JSON.stringify(data));
58
- console.log(result);
59
- NotificationMessage.sendMessage(result.json.message || 'Update success', NotificationColor.Success);
60
- setTimeout(() => {
61
- document.location.reload();
62
- }, 1000);
63
- };
64
- return (
65
- <div css={css}>
66
- <div class='row-box m-menu'>
67
- <span>Profile</span>
68
- </div>
69
- <div class='row-box'>
70
- <button class='button-base' onClick={onSave}>
71
- Update
72
- </button>{' '}
73
- <div>(Password will not be updated if it is empty)</div>
74
- </div>
75
- <div class='row-box mt-l'>
76
- <label class='m-label'>Email:</label> {user.email}
77
- </div>
78
- <div class='row-box mt-l'>
79
- <label class='m-label'>Type:</label> {user.usertype}
80
- </div>
81
- <hr />
82
- <div class='row-box'>
83
- <label class='m-label'>Prefer name:</label>{' '}
84
- <input type='text' class='input-base m-text f-nickname' value={user.nickname} />
85
- </div>
86
- <div class='row-box'>
87
- <label class='m-label'>Password:</label> <input type='password' class='input-base m-text f-password' value='' />
88
- </div>
89
- <div class='row-box'>
90
- <label class='m-label'>Confirm password:</label>{' '}
91
- <input type='password' class='input-base m-text f-password2' value='' />
92
- </div>
93
- </div>
94
- );
95
- };
96
-
97
- export const UserProfilePage = async (props: PageProps) => {
98
- onMount(async () => {
99
- const user = await getUserInfo();
100
- setDom(
101
- <div class='padding-block'>
102
- <PageContent user={user!}></PageContent>
103
- </div>
104
- );
105
- });
106
- const [dom, setDom] = createSignal<any>('Loading...');
107
- return (
108
- <div>
109
- <div>{dom}</div>
110
- </div>
111
- );
112
- };
@@ -1,57 +0,0 @@
1
- import { createSignal, CssProps, getRenderPageProps, onMount } from 'lupine.web';
2
- import { MediaQueryMaxWidth } from 'lupine.web.components';
3
-
4
- export const User1Page = async () => {
5
- const css: CssProps = {
6
- display: 'flex',
7
- flexDirection: 'column',
8
- width: '100%',
9
- maxWidth: MediaQueryMaxWidth.DesktopMax,
10
- margin: 'auto',
11
- '.gauge-box': {
12
- margin: 'auto',
13
- width: '90%',
14
- maxWidth: '500px',
15
- backgroundColor: '#00000000',
16
- boxShadow: '#000000 13.02px 13.02px 52.08px 0px',
17
- borderRadius: '16px',
18
- padding: '40px',
19
- textAlign: 'center',
20
- },
21
- '.sound-box': {
22
- margin: 'auto',
23
- // height: '30px',
24
- textAlign: 'center',
25
- fontSize: '20px',
26
- padding: '10px',
27
- fontWeight: 'bold',
28
- fontFamily: 'Roboto, sans-serif',
29
- },
30
- '.toggle-box': {
31
- textAlign: 'center',
32
- },
33
- };
34
-
35
- const [nodeTest1, setNodeTest1] = createSignal<any>('');
36
- const [nodeTest2, setNodeTest2] = createSignal<any>('Initial Value');
37
- const onClickTuner = async (checked: boolean) => {
38
- setNodeTest1('Value set in onClickTuner event: ' + checked);
39
- };
40
-
41
- onMount(() => {
42
- setNodeTest1('parameter1: ' +
43
- getRenderPageProps().urlParameters?.parameter1 +
44
- ', option1: ' +
45
- getRenderPageProps().urlParameters?.option1);
46
- setNodeTest2('Value set in onLoad event');
47
- });
48
- return (
49
- <div css={css} class='gauge-top'>
50
- <div class='gauge-box'>
51
- <div class='sound-box'>{nodeTest1}</div>
52
- <div class='sound-box'>{nodeTest2}</div>
53
- <div class='toggle-box'>Sample text</div>
54
- </div>
55
- </div>
56
- );
57
- };
@@ -1,19 +0,0 @@
1
- import { getEitherCookie, setCookie } from 'lupine.web';
2
- import { userCookieName } from '../models';
3
-
4
- export type UserCookieType = {
5
- u?: string;
6
- t?: string;
7
- };
8
- export const getCookieUser = (): UserCookieType => {
9
- try {
10
- return JSON.parse(getEitherCookie(userCookieName) || '{}');
11
- } catch (e) {
12
- return {};
13
- }
14
- };
15
- export const setCookieUser = (user: UserCookieType) => {
16
- // for web, client and server are the same domain
17
- // for mobile and desktop, client domain is localhost and userCookieName is for the client
18
- setCookie(userCookieName, JSON.stringify(user || {}), 360, '/');
19
- };
@@ -1,6 +0,0 @@
1
- {
2
- "name": "lupine-template-responsive-starter-api",
3
- "version": "1.0.0",
4
- "dependencies": {},
5
- "devDependencies": {}
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "WEB.pageLimit": "15",
3
- "WEB.siteTitle": "Sample title",
4
- "WEB.siteEmail": "sample@sample.com",
5
- "WEB.siteUrl": "https://sample.com"
6
- }
@@ -1,4 +0,0 @@
1
- #-- sql queries to create tables
2
- #-- Never name a table with plural (such as "users")
3
- #-- Never name a table using a reserved keyword (such as "user")
4
- #-- Never prefix your table name with "tbl" or some other object type prefix
@@ -1,18 +0,0 @@
1
- import { IApiBase, StaticServer, ApiRouter } from 'lupine.api';
2
-
3
- export class RootApi implements IApiBase {
4
- protected router = new ApiRouter();
5
-
6
- constructor() {
7
- this.mountDashboard();
8
- }
9
-
10
- public getRouter(): ApiRouter {
11
- return this.router;
12
- }
13
-
14
- protected mountDashboard() {
15
- const staticServer = new StaticServer();
16
- this.router.use('*', staticServer.processRequest.bind(staticServer));
17
- }
18
- }
@@ -1,76 +0,0 @@
1
- import { CssProps } from 'lupine.web';
2
-
3
- export const appIcons = {
4
- // 记事 (Notes)
5
- 'ma-home-outline': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M9 22V12h6v10'/%3E%3C/svg%3E`,
6
- // 财务 (Finance)
7
- 'icon-finance': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E`,
8
- 'icon-date': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M19 4H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zM16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E`,
9
- 'icon-time': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'/%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M12 6v6l4 2'/%3E%3C/svg%3E`,
10
- 'icon-color': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M12 21a9 9 0 1 1 0-18c1.5 0 2.5 1 2.5 2.5a2 2 0 0 1-1.5 2 2 2 0 0 0-1.5 2c0 1 1 2 2 2h2c2.5 0 4.5 2 4.5 4.5A5.5 5.5 0 0 1 12 21z'/%3E%3Ccircle cx='7.5' cy='10.5' r='1.5' fill='black'/%3E%3Ccircle cx='10.5' cy='7.5' r='1.5' fill='black'/%3E%3Ccircle cx='14.5' cy='8.5' r='1.5' fill='black'/%3E%3Ccircle cx='16.5' cy='12.5' r='1.5' fill='black'/%3E%3C/svg%3E`,
11
- // 记账 (Ledger/List)
12
- 'bs-list': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E`,
13
- // 日记 (Diary/Calendar)
14
- 'ma-pencil-outline': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z'/%3E%3C/svg%3E`,
15
- 'ma-book-outline': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M19 3H7C5.895 3 5 3.895 5 5v14c0 1.105.895 2 2 2h12c1.105 0 2-.895 2-2V5c0-1.105-.895-2-2-2zM5 7h16M7 3v18'/%3E%3C/svg%3E`,
16
- // 工具 (Tools)
17
- 'ma-tools': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E`,
18
- 'ma-calendar-star': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M19 4H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zM16 2v4M8 2v4M3 10h18M12 11.5l1.2 2.5 2.8.4-2 2 .5 2.8-2.5-1.3-2.5 1.3.5-2.8-2-2 2.8-.4L12 11.5z'/%3E%3C/svg%3E`,
19
- 'ma-calendar-check': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M19 4H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zM16 2v4M8 2v4M3 10h18M9 16l2 2 4-4'/%3E%3C/svg%3E`,
20
- 'ma-format-list-checks': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M10 6h10M10 12h10M10 18h10M4 6l1 1 2-2M4 12l1 1 2-2M4 18l1 1 2-2'/%3E%3C/svg%3E`,
21
- 'ma-timer-outline': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M12 2v4M10 2h4M12 6a8 8 0 100 16 8 8 0 000-16zM12 10v4l2 2'/%3E%3C/svg%3E`,
22
- 'ma-pause': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='currentColor' d='M14 19h4V5h-4M6 19h4V5H6v14Z'/%3E%3C/svg%3E`,
23
- 'ma-play': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='currentColor' d='M8 5v14l11-7z'/%3E%3C/svg%3E`,
24
- 'ma-refresh': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='currentColor' d='M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z'/%3E%3C/svg%3E`,
25
- 'ma-check-circle-outline': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='currentColor' d='M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z'/%3E%3C/svg%3E`,
26
- 'ma-checkbox-blank-outline': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='currentColor' d='M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z'/%3E%3C/svg%3E`,
27
- 'ma-checkbox-marked': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='currentColor' d='M19 3H5c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E`,
28
-
29
- // 我的 (Mine)
30
- 'ma-account-cog-outline': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E`,
31
- // 搜索相关 (Search & UI Controls)
32
- 'bs-search': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E`,
33
- 'ma-close': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' width='24' height='24'%3E%3Cpath fill='currentColor' d='M810.7 750.5L750.5 810.7L512 572.2L273.5 810.7L213.3 750.5L451.8 512L213.3 273.5L273.5 213.3L512 451.8L750.5 213.3L810.7 273.5L572.2 512L810.7 750.5z'/%3E%3C/svg%3E`,
34
- 'ma-delete-off-outline': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14ZM10 11v6M14 11v6'/%3E%3C/svg%3E`,
35
- 'ma-cog-outline': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z'/%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1Z'/%3E%3C/svg%3E`,
36
- 'mg-arrow_back_ios_new_outlined': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' width='24' height='24'%3E%3Cpath fill='currentColor' d='M698.7 85.3L272 512L698.7 938.7L758.4 877.9L392.5 512L758.4 146.1z'/%3E%3C/svg%3E`,
37
- 'mg-arrow_forward_ios_outlined': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' width='24' height='24'%3E%3Cpath fill='currentColor' d='M325.3 85.3L752 512L325.3 938.7L265.6 877.9L631.5 512L265.6 146.1z'/%3E%3C/svg%3E`,
38
- 'ma-add': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M12 5v14M5 12h14'/%3E%3C/svg%3E`,
39
-
40
- // Dashboard & Mine Additional Icons
41
- 'ma-account': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E`,
42
- 'ma-text-box-outline': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM9 9h6M9 13h6M9 17h4'/%3E%3C/svg%3E`,
43
- 'ma-star': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E`,
44
-
45
- // Settings Utility Icons
46
- 'ma-download': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/%3E%3C/svg%3E`,
47
- 'ma-upload': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12'/%3E%3C/svg%3E`,
48
- 'ma-chevron-right': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M9 18l6-6-6-6'/%3E%3C/svg%3E`,
49
- 'ma-chevron-left': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M15 18l-6-6 6-6'/%3E%3C/svg%3E`,
50
- 'ma-delete-outline': `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14M10 11v6M14 11v6'/%3E%3C/svg%3E`,
51
- };
52
-
53
- export const appIconsCss: CssProps = {
54
- '.ifc-icon': {
55
- display: 'inline-block',
56
- width: '24px',
57
- height: '24px',
58
- maskRepeat: 'no-repeat',
59
- maskPosition: 'center',
60
- maskSize: 'contain',
61
- '-webkit-mask-repeat': 'no-repeat',
62
- '-webkit-mask-position': 'center',
63
- '-webkit-mask-size': 'contain',
64
- WebkitMaskRepeat: 'no-repeat',
65
- WebkitMaskPosition: 'center',
66
- WebkitMaskSize: 'contain',
67
- backgroundColor: 'currentColor',
68
- },
69
- ...Object.entries(appIcons).reduce((acc: any, [key, svg]) => {
70
- acc['.ifc-icon.' + key] = {
71
- '-webkit-mask-image': 'url("' + svg + '")',
72
- maskImage: 'url("' + svg + '")',
73
- };
74
- return acc;
75
- }, {} as any),
76
- };
@@ -1,93 +0,0 @@
1
- import { bindGlobalStyle, CssProps } from 'lupine.web';
2
-
3
- export const getHistoryList = (key: string): string[] => {
4
- try {
5
- const hist = localStorage.getItem(`search_history_${key}`);
6
- return hist ? JSON.parse(hist) : [];
7
- } catch (e) {
8
- return [];
9
- }
10
- };
11
-
12
- export const addHistoryItem = (key: string, item: string) => {
13
- const current = getHistoryList(key);
14
- const filtered = current.filter((x) => x !== item);
15
- filtered.unshift(item);
16
- // keep max 20
17
- if (filtered.length > 20) {
18
- filtered.pop();
19
- }
20
- localStorage.setItem(`search_history_${key}`, JSON.stringify(filtered));
21
- };
22
-
23
- export const clearHistoryList = (key: string) => {
24
- localStorage.removeItem(`search_history_${key}`);
25
- };
26
-
27
- export const InputHistoryComponent = (props: {
28
- label?: string;
29
- historyKey: string;
30
- onClearHistory: () => void;
31
- onItemClick: (item: string) => void;
32
- }) => {
33
- const list = getHistoryList(props.historyKey);
34
- const css: CssProps = {
35
- padding: '4px 0',
36
- '.history-c-header': {
37
- display: 'flex',
38
- flexDirection: 'row',
39
- justifyContent: 'space-between',
40
- alignItems: 'center',
41
- padding: '4px 0',
42
- },
43
- '.history-c-h-title': {
44
- fontSize: '12px',
45
- },
46
- '.history-c-h-icon': {
47
- fontSize: '16px',
48
- cursor: 'pointer',
49
- },
50
- '.history-c-body': {
51
- display: 'flex',
52
- flexWrap: 'wrap',
53
- gap: '8px',
54
- marginTop: '8px',
55
- },
56
- '.history-c-item': {
57
- padding: '4px 12px',
58
- borderRadius: '6px',
59
- border: '1px solid var(--secondary-border-color)',
60
- backgroundColor: 'var(--secondary-bg-color)',
61
- color: 'var(--primary-color)',
62
- fontSize: '13px',
63
- width: 'fit-content',
64
- cursor: 'pointer',
65
- },
66
- '.history-c-item:hover': {
67
- backgroundColor: 'var(--activatable-bg-color-hover, rgba(0,0,0,0.04))',
68
- },
69
- };
70
- bindGlobalStyle('history-c-box', css);
71
-
72
- if (list.length === 0) {
73
- return <></>;
74
- }
75
-
76
- return (
77
- <div css={css} class='history-c-box'>
78
- <div class='history-c-header'>
79
- <div class='history-c-h-title'>{props.label || 'History Search List'}</div>
80
- <div class='history-c-h-icon'>
81
- <i class='ifc-icon ma-delete-off-outline' onClick={props.onClearHistory}></i>
82
- </div>
83
- </div>
84
- <div class='history-c-body'>
85
- {list.map((item) => (
86
- <div class='history-c-item' onClick={() => props.onItemClick(item)}>
87
- {item}
88
- </div>
89
- ))}
90
- </div>
91
- </div>
92
- );
93
- };