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.
- package/README.md +31 -0
- package/index.js +238 -112
- package/package.json +1 -1
- package/templates/common/.agents/skills/lupine-framework/SKILL.md +63 -0
- package/templates/common/.agents/skills/lupine-framework/references/backend-api.md +113 -0
- package/templates/common/.agents/skills/lupine-framework/references/icon-handling.md +71 -0
- package/templates/common/.agents/skills/lupine-framework/references/mobile-interactions.md +29 -0
- package/templates/common/.agents/skills/lupine-framework/references/native-apps.md +190 -0
- package/templates/common/.agents/skills/lupine-framework/references/navigation-and-routing.md +55 -0
- package/templates/common/.agents/skills/lupine-framework/references/reactivity-and-state.md +108 -0
- package/templates/common/.agents/skills/lupine-framework/references/styling-and-themes.md +121 -0
- package/templates/common/.env.mobile +4 -3
- package/templates/common/_env +10 -4
- package/templates/common/apps/server/README.md +10 -0
- package/templates/common/dev/cp-folder.js +9 -4
- package/templates/lupine-template-cv-starter/README.md +37 -0
- package/templates/lupine-template-cv-starter/app/package.json +20 -0
- package/templates/lupine-template-cv-starter/app/src/app.tsx +6 -0
- package/templates/lupine-template-cv-starter/app/src/index.native.tsx +4 -0
- package/templates/lupine-template-cv-starter/app/src/index.test.tsx +71 -0
- package/templates/lupine-template-cv-starter/app/src/index.web.tsx +28 -0
- package/templates/lupine-template-cv-starter/app/tsconfig.json +17 -0
- package/templates/lupine-template-cv-starter/lupine.json +8 -7
- package/templates/lupine-template-cv-starter/web/src/index.html +9 -2
- package/templates/lupine-template-cv-starter/web/src/index.tsx +9 -23
- package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.html +9 -2
- package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.tsx +4 -29
- package/templates/lupine-template-doc-starter/README.md +37 -0
- package/templates/lupine-template-doc-starter/app/package.json +20 -0
- package/templates/lupine-template-doc-starter/app/src/app.tsx +6 -0
- package/templates/lupine-template-doc-starter/app/src/index.native.tsx +4 -0
- package/templates/lupine-template-doc-starter/app/src/index.test.tsx +78 -0
- package/templates/lupine-template-doc-starter/app/src/index.web.tsx +28 -0
- package/templates/lupine-template-doc-starter/app/tsconfig.json +17 -0
- package/templates/lupine-template-doc-starter/lupine.json +8 -7
- package/templates/lupine-template-doc-starter/web/src/index.html +9 -2
- package/templates/lupine-template-doc-starter/web/src/index.tsx +9 -23
- package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.html +9 -2
- package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.tsx +4 -29
- package/templates/lupine-template-fullstack-note/README.md +83 -0
- package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/api/package.json +1 -1
- package/templates/lupine-template-fullstack-note/api/resources/install.mysql.sql +32 -0
- package/templates/lupine-template-fullstack-note/api/resources/install.sqlite.sql +27 -0
- package/templates/lupine-template-fullstack-note/api/src/service/answer.ts +39 -0
- package/templates/lupine-template-fullstack-note/api/src/service/api.ts +52 -0
- package/templates/lupine-template-fullstack-note/api/src/service/db.ts +78 -0
- package/templates/lupine-template-fullstack-note/api/src/service/notes-api.ts +86 -0
- package/templates/lupine-template-fullstack-note/api/src/service/root-api.ts +19 -0
- package/templates/lupine-template-fullstack-note/api/src/service/user-api.ts +182 -0
- package/templates/lupine-template-fullstack-note/app/package.json +19 -0
- package/templates/lupine-template-fullstack-note/app/src/app.tsx +75 -0
- package/templates/lupine-template-fullstack-note/app/src/index.native.tsx +4 -0
- package/templates/lupine-template-fullstack-note/app/src/index.test.tsx +373 -0
- package/templates/lupine-template-fullstack-note/app/src/index.web.tsx +20 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/components.tsx +65 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/details.tsx +38 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/discover.tsx +25 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/home.tsx +76 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/inbox.tsx +49 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/login.tsx +54 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/me.tsx +32 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/notes.tsx +128 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/settings.tsx +45 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/AppMenu.tsx +44 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/api.ts +159 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/data.ts +20 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/locales/ja.ts +80 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/locales/zh-CN.ts +80 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/texts.ts +14 -0
- package/templates/lupine-template-fullstack-note/app/tsconfig.json +17 -0
- package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/lupine.json +4 -2
- package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/web/package.json +1 -1
- package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/web/src/index.html +10 -3
- package/templates/lupine-template-fullstack-note/web/src/index.tsx +15 -0
- package/templates/lupine-template-fullstack-starter/README.md +70 -0
- package/templates/lupine-template-fullstack-starter/api/package.json +10 -0
- package/templates/lupine-template-fullstack-starter/api/resources/install.mysql.sql +107 -0
- package/templates/lupine-template-fullstack-starter/api/resources/install.sqlite.sql +75 -0
- package/templates/lupine-template-fullstack-starter/api/src/lang/api-lang-en.ts +39 -0
- package/templates/lupine-template-fullstack-starter/api/src/lang/api-lang-zh-cn.ts +37 -0
- package/templates/lupine-template-fullstack-starter/api/src/service/admin-api.ts +139 -0
- package/templates/lupine-template-fullstack-starter/api/src/service/api.ts +111 -0
- package/templates/lupine-template-fullstack-starter/api/src/service/contact-api.ts +50 -0
- package/templates/lupine-template-fullstack-starter/api/src/service/file-api-base.ts +30 -0
- package/templates/lupine-template-fullstack-starter/api/src/service/root-api.ts +28 -0
- package/templates/lupine-template-fullstack-starter/api/src/service/send-email.ts +47 -0
- package/templates/lupine-template-fullstack-starter/api/src/service/setting-api.ts +60 -0
- package/templates/lupine-template-fullstack-starter/api/src/service/user-api.ts +1046 -0
- package/templates/lupine-template-fullstack-starter/app/assets/sample.png +0 -0
- package/templates/lupine-template-fullstack-starter/app/package.json +20 -0
- package/templates/lupine-template-fullstack-starter/app/src/app.tsx +76 -0
- package/templates/lupine-template-fullstack-starter/app/src/index.native.tsx +4 -0
- package/templates/lupine-template-fullstack-starter/app/src/index.test.tsx +276 -0
- package/templates/lupine-template-fullstack-starter/app/src/index.web.tsx +28 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/about.tsx +27 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/contact.tsx +41 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/favorite.tsx +27 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/home.tsx +63 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/login.tsx +63 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/mine.tsx +44 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/profile.tsx +58 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/register.tsx +48 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/reset-password.tsx +41 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/settings.tsx +33 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/story.tsx +46 -0
- package/templates/lupine-template-fullstack-starter/app/src/shell/api.ts +127 -0
- package/templates/lupine-template-fullstack-starter/app/src/shell/parts.tsx +100 -0
- package/templates/lupine-template-fullstack-starter/app/src/shell/stories.ts +65 -0
- package/templates/lupine-template-fullstack-starter/app/src/shell/texts.ts +79 -0
- package/templates/lupine-template-fullstack-starter/app/tsconfig.json +17 -0
- package/templates/lupine-template-fullstack-starter/lupine.json +31 -0
- package/templates/lupine-template-fullstack-starter/web/assets/android-chrome-192x192.png +0 -0
- package/templates/lupine-template-fullstack-starter/web/assets/apple-touch-icon.png +0 -0
- package/templates/lupine-template-fullstack-starter/web/assets/favicon-16x16.png +0 -0
- package/templates/lupine-template-fullstack-starter/web/assets/favicon-32x32.png +0 -0
- package/templates/lupine-template-fullstack-starter/web/assets/favicon.ico +0 -0
- package/templates/lupine-template-fullstack-starter/web/assets/icons-font/License-carbon-icons.txt +71 -0
- package/templates/lupine-template-fullstack-starter/web/assets/icons-font/License-material-design.txt +20 -0
- package/templates/lupine-template-fullstack-starter/web/assets/icons-font/i-font.woff2 +0 -0
- package/templates/lupine-template-fullstack-starter/web/assets/icons-font/sample.html +124 -0
- package/templates/lupine-template-fullstack-starter/web/assets/icons-font/style.css +103 -0
- package/templates/lupine-template-fullstack-starter/web/assets/lupine-flower.png +0 -0
- package/templates/lupine-template-fullstack-starter/web/assets/lupine.svg +71 -0
- package/templates/lupine-template-fullstack-starter/web/assets/site.webmanifest +14 -0
- package/templates/lupine-template-fullstack-starter/web/icons-font.config.js +129 -0
- package/templates/{lupine-template-responsive-starter/api → lupine-template-fullstack-starter/web}/package.json +1 -1
- package/templates/lupine-template-fullstack-starter/web/src/admin/admin-patch.tsx +34 -0
- package/templates/lupine-template-fullstack-starter/web/src/admin/components/home-search-component.tsx +125 -0
- package/templates/lupine-template-fullstack-starter/web/src/admin/components/story-card.tsx +105 -0
- package/templates/lupine-template-fullstack-starter/web/src/admin/components/story-list.tsx +105 -0
- package/templates/lupine-template-fullstack-starter/web/src/admin/components/story-props.ts +34 -0
- package/templates/lupine-template-fullstack-starter/web/src/admin/index.html +23 -0
- package/templates/lupine-template-fullstack-starter/web/src/admin/index.tsx +49 -0
- package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-cfg.tsx +144 -0
- package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-item-edit.tsx +20 -0
- package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-item-list.tsx +23 -0
- package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-user.tsx +145 -0
- package/templates/lupine-template-fullstack-starter/web/src/index.html +28 -0
- package/templates/lupine-template-fullstack-starter/web/src/index.tsx +16 -0
- package/templates/lupine-template-fullstack-starter/web/src/services/fetch-data.ts +37 -0
- package/templates/lupine-template-fullstack-starter/web/src/styles/base-css.ts +14 -0
- package/templates/{lupine-template-hello-world → lupine-template-fullstack-starter}/web/src/styles/global.css +10 -57
- package/templates/{lupine-template-hello-world → lupine-template-fullstack-starter}/web/src/styles/theme.ts +2 -1
- package/templates/lupine-template-responsive-starter/README.md +51 -0
- package/templates/lupine-template-responsive-starter/app/package.json +19 -0
- package/templates/lupine-template-responsive-starter/app/src/app.tsx +80 -0
- package/templates/lupine-template-responsive-starter/app/src/index.native.tsx +4 -0
- package/templates/lupine-template-responsive-starter/app/src/index.test.tsx +283 -0
- package/templates/lupine-template-responsive-starter/app/src/index.web.tsx +31 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/about.tsx +23 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/finance.tsx +48 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/mine.tsx +60 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/not-found.tsx +9 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/note-detail.tsx +43 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/note-edit.tsx +45 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/note-search.tsx +62 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/notes.tsx +71 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/settings.tsx +55 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/tools.tsx +112 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/icons.ts +7 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/layout.ts +18 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/locales/zh-CN.ts +89 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/menu.tsx +81 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/nav.ts +12 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/store.ts +72 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/texts.ts +11 -0
- package/templates/lupine-template-responsive-starter/app/tsconfig.json +17 -0
- package/templates/lupine-template-responsive-starter/lupine.json +7 -6
- package/templates/lupine-template-responsive-starter/web/src/index.html +9 -2
- package/templates/lupine-template-responsive-starter/web/src/index.tsx +9 -34
- package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.html +12 -6
- package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.tsx +12 -31
- package/templates/common/AI_CONTEXT.md +0 -1002
- package/templates/common/apps/server/src/app-loader.ts +0 -4
- package/templates/lupine-template-cv-starter/api/package.json +0 -6
- package/templates/lupine-template-cv-starter/api/resources/install.sqlite.sql +0 -4
- package/templates/lupine-template-cv-starter/api/src/index.ts +0 -15
- package/templates/lupine-template-cv-starter/web/src/styles/base-css.ts +0 -15
- package/templates/lupine-template-doc-starter/api/package.json +0 -6
- package/templates/lupine-template-doc-starter/api/resources/config_default.json +0 -6
- package/templates/lupine-template-doc-starter/api/resources/install.sqlite.sql +0 -4
- package/templates/lupine-template-doc-starter/api/src/index.ts +0 -15
- package/templates/lupine-template-doc-starter/api/src/resources/config_default.json +0 -6
- package/templates/lupine-template-doc-starter/api/src/resources/install.sqlite.sql +0 -4
- package/templates/lupine-template-doc-starter/web/src/client-env-keys.ts +0 -5
- package/templates/lupine-template-doc-starter/web/src/styles/base-css.ts +0 -15
- package/templates/lupine-template-hello-world/api/resources/config_default.json +0 -6
- package/templates/lupine-template-hello-world/api/resources/install.sqlite.sql +0 -4
- package/templates/lupine-template-hello-world/api/src/service/root-api.ts +0 -18
- package/templates/lupine-template-hello-world/web/src/index.tsx +0 -73
- package/templates/lupine-template-hello-world/web/src/styles/app.css +0 -0
- package/templates/lupine-template-hello-world/web/src/styles/base-css.ts +0 -1
- package/templates/lupine-template-responsive-starter/api/resources/config_default.json +0 -6
- package/templates/lupine-template-responsive-starter/api/resources/install.sqlite.sql +0 -4
- package/templates/lupine-template-responsive-starter/api/src/service/root-api.ts +0 -18
- package/templates/lupine-template-responsive-starter/web/src/app-icons.ts +0 -76
- package/templates/lupine-template-responsive-starter/web/src/components/input-history-component.tsx +0 -93
- package/templates/lupine-template-responsive-starter/web/src/components/mine-about-page.tsx +0 -86
- package/templates/lupine-template-responsive-starter/web/src/components/mine-premium-page.tsx +0 -80
- package/templates/lupine-template-responsive-starter/web/src/components/mine-settings-page.tsx +0 -220
- package/templates/lupine-template-responsive-starter/web/src/components/mobile-top-search-menu.tsx +0 -119
- package/templates/lupine-template-responsive-starter/web/src/components/note-detail.tsx +0 -116
- package/templates/lupine-template-responsive-starter/web/src/components/note-edit.tsx +0 -154
- package/templates/lupine-template-responsive-starter/web/src/components/note-search-page.tsx +0 -193
- package/templates/lupine-template-responsive-starter/web/src/components/search-input.tsx +0 -95
- package/templates/lupine-template-responsive-starter/web/src/components/side-menu-content.tsx +0 -182
- package/templates/lupine-template-responsive-starter/web/src/frames/app-responsive-frame.tsx +0 -52
- package/templates/lupine-template-responsive-starter/web/src/pages/about-page.tsx +0 -43
- package/templates/lupine-template-responsive-starter/web/src/pages/finance-page.tsx +0 -46
- package/templates/lupine-template-responsive-starter/web/src/pages/home-page.tsx +0 -452
- package/templates/lupine-template-responsive-starter/web/src/pages/mine-page.tsx +0 -325
- package/templates/lupine-template-responsive-starter/web/src/pages/tools-page.tsx +0 -46
- package/templates/lupine-template-responsive-starter/web/src/services/local-notes-service.ts +0 -87
- package/templates/lupine-template-responsive-starter/web/src/services/mine-service.ts +0 -45
- package/templates/lupine-template-responsive-starter/web/src/styles/app.css +0 -0
- package/templates/lupine-template-responsive-starter/web/src/styles/base-css.ts +0 -65
- package/templates/lupine-template-responsive-starter/web/src/styles/global.css +0 -2130
- package/templates/lupine-template-responsive-starter/web/src/styles/theme.ts +0 -16
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/01-experience/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/02-projects/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/03-skills/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/04-education/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/01-experience/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/02-projects/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/03-skills/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/04-education/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/01-experience/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/02-projects/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/03-skills/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/04-education/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/01-experience/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/02-projects/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/03-skills/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/04-education/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/index.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/list.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/install.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/started.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/index.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/index.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/index.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/list.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/install.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/started.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/index.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/index.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/list.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/install.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/started.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/index.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/index.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/index.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/list.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/install.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/started.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
- /package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/api/src/index.ts +0 -0
- /package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/web/assets/favicon.ico +0 -0
- /package/templates/{lupine-template-cv-starter → lupine-template-fullstack-starter}/api/resources/config_default.json +0 -0
- /package/templates/{lupine-template-responsive-starter → lupine-template-fullstack-starter}/api/src/index.ts +0 -0
- /package/templates/{lupine-template-cv-starter/web/src → lupine-template-fullstack-starter/web/src/models}/client-env-keys.ts +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Define icons for generating fonts
|
|
3
|
+
|
|
4
|
+
Suggestions:
|
|
5
|
+
1, use WOFF2 for major browsers except IE;
|
|
6
|
+
Or: 2, use WOFF for major browsers and IE 9~, Edge 12~
|
|
7
|
+
All 1, 2 need this code in HTML: `<i class="ifc-icon icon_name"></i>`
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var path = require('path');
|
|
11
|
+
var cssTemplate = `
|
|
12
|
+
/*font-face*/
|
|
13
|
+
.ifc-box {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
position: relative;
|
|
16
|
+
border-radius: 3px;
|
|
17
|
+
text-align: center;
|
|
18
|
+
vertical-align: middle;
|
|
19
|
+
border: solid 1px #00f;
|
|
20
|
+
width: 40px;
|
|
21
|
+
height: 40px;
|
|
22
|
+
font-size: 20px;
|
|
23
|
+
color: blue;
|
|
24
|
+
margin: 5px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ifc-icon {
|
|
28
|
+
font-size: inherit;
|
|
29
|
+
display: inline-block;
|
|
30
|
+
font-family: '#font-family#';
|
|
31
|
+
font-style: normal;
|
|
32
|
+
font-weight: 400;
|
|
33
|
+
font-variant: normal;
|
|
34
|
+
text-transform: none;
|
|
35
|
+
text-rendering: auto;
|
|
36
|
+
line-height: 1em;
|
|
37
|
+
vertical-align: middle;
|
|
38
|
+
text-align: center;
|
|
39
|
+
text-decoration: inherit;
|
|
40
|
+
-moz-osx-font-smoothing: grayscale;
|
|
41
|
+
-webkit-font-smoothing: antialiased;
|
|
42
|
+
margin: auto;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
<div class='ifc-over-box'>
|
|
47
|
+
<i class='ifc-icon ma-refresh'></i>
|
|
48
|
+
<i class='ifc-icon ma-play ifc-over'></i>
|
|
49
|
+
</div>
|
|
50
|
+
*/
|
|
51
|
+
.ifc-over-box {
|
|
52
|
+
display: flex;
|
|
53
|
+
position: relative;
|
|
54
|
+
width: min-content;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ifc-over {
|
|
58
|
+
position: absolute;
|
|
59
|
+
left: 50%;
|
|
60
|
+
top: 50%;
|
|
61
|
+
font-size: 60%;
|
|
62
|
+
z-index: 1;
|
|
63
|
+
color: red;
|
|
64
|
+
transform: translate(-50%, -50%);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Animation for spinners */
|
|
68
|
+
.ifc-spin {
|
|
69
|
+
animation: ifc-spin-f 2s infinite linear;
|
|
70
|
+
display: inline-block;
|
|
71
|
+
}
|
|
72
|
+
/* @keyframes for IE10~ and major browsers */
|
|
73
|
+
@keyframes ifc-spin-f {
|
|
74
|
+
0% {
|
|
75
|
+
transform: rotate(0deg);
|
|
76
|
+
}
|
|
77
|
+
100% {
|
|
78
|
+
transform: rotate(359deg);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/*icons-css*/
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
var htmlTemplate = `
|
|
86
|
+
<!DOCTYPE html><html><head>
|
|
87
|
+
<title>icons-font-customization sample</title>
|
|
88
|
+
<link rel="stylesheet" type="text/css" href="style.css">
|
|
89
|
+
</head><body><div class="sample">
|
|
90
|
+
#icons-html#</div></body></html>
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
module.exports = {
|
|
94
|
+
fontName: 'i-font',
|
|
95
|
+
outputPath: path.join(__dirname, 'assets/icons-font/'),
|
|
96
|
+
outputName: 'i-font', // automatically add font extension to it
|
|
97
|
+
startChar: 10000, // unicode start number
|
|
98
|
+
svgicons2svgfont: {
|
|
99
|
+
fontHeight: 1024,
|
|
100
|
+
},
|
|
101
|
+
icons: [
|
|
102
|
+
// copy svg from icons-font-customization locally or remotely
|
|
103
|
+
{
|
|
104
|
+
path: 'material-design/svg/theme-light-dark.svg',
|
|
105
|
+
name: 'ma-theme-light-dark',
|
|
106
|
+
},
|
|
107
|
+
{ path: 'font-awesome/brands/apple.svg', name: 'fa-apple' },
|
|
108
|
+
{ path: 'font-awesome/brands/android.svg', name: 'fa-android' },
|
|
109
|
+
{ path: 'carbon-icons/svg/app-services.svg', name: 'cb-app-services' },
|
|
110
|
+
{ path: 'unicons/line/16-plus.svg', name: 'un-16-plus' },
|
|
111
|
+
{ path: 'ant-design-icons/outlined/drag.svg', name: 'at-drag' },
|
|
112
|
+
// or add local svg files
|
|
113
|
+
// { path: '../src/asset/icons/pin.svg', name: 'my-pin', iconsRoot: __dirname },
|
|
114
|
+
],
|
|
115
|
+
fontType: {
|
|
116
|
+
woff2: true,
|
|
117
|
+
woff: false,
|
|
118
|
+
ttf: false,
|
|
119
|
+
eot: false,
|
|
120
|
+
svg: false,
|
|
121
|
+
},
|
|
122
|
+
cssTemplate: cssTemplate,
|
|
123
|
+
htmlTemplate: htmlTemplate,
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// Or pass parameters
|
|
127
|
+
var parameters = { '--config': path.join(__dirname, 'icons-font.config.js') };
|
|
128
|
+
var cmd = require('icons-font-command');
|
|
129
|
+
cmd.IconsFontLite.generateFont(parameters);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { adminFrameHelper } from 'lupine.api/admin';
|
|
2
|
+
import { clearCookie } from 'lupine.web';
|
|
3
|
+
import { AdminCfgPage } from './pages/admin-cfg';
|
|
4
|
+
import { AdminItemListPage } from './pages/admin-item-list';
|
|
5
|
+
import { AdminUserPage } from './pages/admin-user';
|
|
6
|
+
|
|
7
|
+
export const patchAdminFrame = () => {
|
|
8
|
+
// the pages of the site, for the admins of the app and the developer
|
|
9
|
+
adminFrameHelper.insertMenuItem(
|
|
10
|
+
[
|
|
11
|
+
{
|
|
12
|
+
id: 'site',
|
|
13
|
+
text: 'Site',
|
|
14
|
+
url: '',
|
|
15
|
+
items: [
|
|
16
|
+
{ id: 'site-items', text: 'Items', icon: 'list', url: '', js: () => adminFrameHelper.addPanel('Items', <AdminItemListPage />) },
|
|
17
|
+
{ id: 'site-users', text: 'Users', icon: 'shield', url: '', js: () => adminFrameHelper.addPanel('Users', <AdminUserPage />) },
|
|
18
|
+
{ id: 'site-website', text: 'Website', icon: 'globe', url: '', js: () => adminFrameHelper.addPanel('Website', <AdminCfgPage />) },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
'contents'
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
adminFrameHelper.setAppAdminHookCheckLogin(async (authResponse: any) => {
|
|
26
|
+
if (authResponse && authResponse.user && authResponse.user.admin === '1') {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
});
|
|
31
|
+
adminFrameHelper.setAppAdminHookLogout(async () => {
|
|
32
|
+
clearCookie('_token', '/');
|
|
33
|
+
});
|
|
34
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { createSignal, CssProps, onMount } from 'lupine.web';
|
|
2
|
+
import { adminFrameHelper } from 'lupine.api/admin';
|
|
3
|
+
import { AdminItemEditPage } from '../pages/admin-item-edit';
|
|
4
|
+
import { Toast } from 'lupine.native.components';
|
|
5
|
+
import { StoryListComponent } from './story-list';
|
|
6
|
+
import { StoryCardShortProps } from './story-props';
|
|
7
|
+
// the sample stories of the app
|
|
8
|
+
import { stories } from '../../../../app/src/shell/stories';
|
|
9
|
+
|
|
10
|
+
// A real site gets them from its API: fetchData('/api/stories')
|
|
11
|
+
export const getMusicList = async (management: boolean) => {
|
|
12
|
+
return {
|
|
13
|
+
count: stories.length,
|
|
14
|
+
management,
|
|
15
|
+
results: stories.map(
|
|
16
|
+
(s) =>
|
|
17
|
+
({
|
|
18
|
+
id: s.id,
|
|
19
|
+
title: s.title,
|
|
20
|
+
cover_file: s.cover,
|
|
21
|
+
author: s.author,
|
|
22
|
+
view_count: s.views,
|
|
23
|
+
download_count: 0,
|
|
24
|
+
collect_count: s.favorites,
|
|
25
|
+
start_time_seconds: new Date().getTime() / 1000,
|
|
26
|
+
} as StoryCardShortProps)
|
|
27
|
+
),
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type SearchMusicProps = {
|
|
32
|
+
management: boolean;
|
|
33
|
+
};
|
|
34
|
+
export const HomeSearchComponent = (props: SearchMusicProps) => {
|
|
35
|
+
const css: CssProps = {
|
|
36
|
+
display: 'flex',
|
|
37
|
+
// paddingTop: '4px',
|
|
38
|
+
// paddingRight: '8px',
|
|
39
|
+
flexDirection: 'column',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
width: '100%',
|
|
42
|
+
'.search-result-box': {
|
|
43
|
+
width: '100%',
|
|
44
|
+
},
|
|
45
|
+
'.navigation-bar-box': {
|
|
46
|
+
width: '100%',
|
|
47
|
+
height: '20px',
|
|
48
|
+
position: 'relative',
|
|
49
|
+
marginBottom: '16px',
|
|
50
|
+
// textAlign: 'center',
|
|
51
|
+
},
|
|
52
|
+
'.navigation-bar': {
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
top: '0',
|
|
55
|
+
left: '0',
|
|
56
|
+
width: '100%',
|
|
57
|
+
display: 'flex',
|
|
58
|
+
whiteSpace: 'nowrap',
|
|
59
|
+
overflowX: 'auto',
|
|
60
|
+
scrollbarWidth: 'none',
|
|
61
|
+
// justifyContent: 'center',
|
|
62
|
+
// textAlign: 'left',
|
|
63
|
+
},
|
|
64
|
+
// '.navigation-bar:has(scrollbar), .navigation-bar::-webkit-scrollbar': {
|
|
65
|
+
// justifyContent: 'flex-start',
|
|
66
|
+
// },
|
|
67
|
+
'.navigation-item': {
|
|
68
|
+
padding: '6px 10px',
|
|
69
|
+
borderRadius: '12px',
|
|
70
|
+
cursor: 'pointer',
|
|
71
|
+
'&:hover': {
|
|
72
|
+
backgroundColor: '#f0f0f0',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
'.navigation-item.active': {
|
|
76
|
+
backgroundColor: '#f0f0f0',
|
|
77
|
+
fontWeight: 600,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const [dom, setDom] = createSignal<any>('');
|
|
82
|
+
onMount(() => onSearch());
|
|
83
|
+
const onSearch = async () => {
|
|
84
|
+
const result = await getMusicList(props.management);
|
|
85
|
+
setDom(
|
|
86
|
+
<div>
|
|
87
|
+
{result.count > 0 ? (
|
|
88
|
+
<StoryListComponent items={result.results} count={result.count} management={props.management} />
|
|
89
|
+
) : (
|
|
90
|
+
'no result'
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
const onAdd = () => {
|
|
96
|
+
adminFrameHelper.addPanel('New', <AdminItemEditPage id='new' />);
|
|
97
|
+
};
|
|
98
|
+
return (
|
|
99
|
+
<div css={css} class='search-music-box'>
|
|
100
|
+
<div className='row-box search-box m-auto p-m w-100p'>
|
|
101
|
+
<input class='input-base txt-search flex-1' type='text' placeholder='Please input keywords' />
|
|
102
|
+
<button class='button-base btn-search' onClick={onSearch}>
|
|
103
|
+
Search
|
|
104
|
+
</button>
|
|
105
|
+
{props.management && (
|
|
106
|
+
<button class='button-base btn-add ml-m' onClick={onAdd}>
|
|
107
|
+
Add
|
|
108
|
+
</button>
|
|
109
|
+
)}
|
|
110
|
+
</div>
|
|
111
|
+
<div class='navigation-bar-box mt-m'>
|
|
112
|
+
<div class='navigation-bar'>
|
|
113
|
+
<div class='navigation-item active'>All</div>
|
|
114
|
+
<div class='navigation-item'>Chinese</div>
|
|
115
|
+
<div class='navigation-item'>Europe</div>
|
|
116
|
+
<div class='navigation-item'>Asia</div>
|
|
117
|
+
<div class='navigation-item'>Dimension</div>
|
|
118
|
+
<div class='navigation-item'>Ancient</div>
|
|
119
|
+
<div class='navigation-item'>Simple</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
<div class='search-result-box'>{dom}</div>
|
|
123
|
+
</div>
|
|
124
|
+
);
|
|
125
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { CssProps, Icon } from 'lupine.web';
|
|
2
|
+
import { adminFrameHelper } from 'lupine.api/admin';
|
|
3
|
+
import { AdminItemEditPage } from '../pages/admin-item-edit';
|
|
4
|
+
import { ActionSheet, Toast } from 'lupine.native.components';
|
|
5
|
+
import * as icons from 'lupine.core/icons';
|
|
6
|
+
import { StoryCardShortProps } from './story-props';
|
|
7
|
+
|
|
8
|
+
export const StoryCard = (props: StoryCardShortProps) => {
|
|
9
|
+
const css: CssProps = {
|
|
10
|
+
clear: 'both',
|
|
11
|
+
margin: 'auto',
|
|
12
|
+
height: 'auto',
|
|
13
|
+
lineHeight: '1.6',
|
|
14
|
+
paddingBottom: '16px',
|
|
15
|
+
maxWidth: '100%',
|
|
16
|
+
width: '100%',
|
|
17
|
+
position: 'relative',
|
|
18
|
+
'.story-card-title-link': {
|
|
19
|
+
fontSize: '120%',
|
|
20
|
+
color: 'black',
|
|
21
|
+
fontWeight: 'bold',
|
|
22
|
+
},
|
|
23
|
+
'.story-card-row .tag': {
|
|
24
|
+
color: '#999',
|
|
25
|
+
verticalAlign: 'bottom',
|
|
26
|
+
},
|
|
27
|
+
'.story-card-row .label.name': {
|
|
28
|
+
maxWidth: '110px',
|
|
29
|
+
display: 'inline-block',
|
|
30
|
+
whiteSpace: 'nowrap',
|
|
31
|
+
overflow: 'hidden',
|
|
32
|
+
textOverflow: 'ellipsis',
|
|
33
|
+
verticalAlign: 'bottom',
|
|
34
|
+
},
|
|
35
|
+
'.story-card-img': {
|
|
36
|
+
float: 'left',
|
|
37
|
+
width: '100%',
|
|
38
|
+
},
|
|
39
|
+
'.story-card-buttons': {
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
top: '-2px',
|
|
42
|
+
right: '0',
|
|
43
|
+
justifyContent: 'flex-end',
|
|
44
|
+
},
|
|
45
|
+
'.story-card-link': {
|
|
46
|
+
textDecoration: 'none',
|
|
47
|
+
color: 'var(--primary-color)',
|
|
48
|
+
},
|
|
49
|
+
'.story-card-title .title': {
|
|
50
|
+
wordBreak: 'break-all',
|
|
51
|
+
fontWeight: 500,
|
|
52
|
+
fontSize: '15px',
|
|
53
|
+
lineHeight: '140%',
|
|
54
|
+
},
|
|
55
|
+
'.story-card-info .author': {
|
|
56
|
+
wordBreak: 'break-all',
|
|
57
|
+
fontSize: '12px',
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const onEdit = () => {
|
|
62
|
+
adminFrameHelper.addPanel(`Edit ${props.id}`, <AdminItemEditPage id={String(props.id)} />);
|
|
63
|
+
};
|
|
64
|
+
const onDelete = async () => {
|
|
65
|
+
const index = await ActionSheet.select({ title: 'Are you sure you want to delete this record and related files?', options: ['Delete'], cancelText: 'Cancel' });
|
|
66
|
+
if (index === 0) {
|
|
67
|
+
props.onDeleted?.();
|
|
68
|
+
Toast.success('Delete successfully');
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return (
|
|
72
|
+
<section css={css} class='story-card-box'>
|
|
73
|
+
{props.management && (
|
|
74
|
+
<div class='story-card-buttons pr-s'>
|
|
75
|
+
<button class='button-base button-ss' onClick={onEdit}>
|
|
76
|
+
Edit
|
|
77
|
+
</button>
|
|
78
|
+
<button class='button-base button-ss' onClick={onDelete}>
|
|
79
|
+
Delete
|
|
80
|
+
</button>
|
|
81
|
+
</div>
|
|
82
|
+
)}
|
|
83
|
+
{/* the page of the story in the app */}
|
|
84
|
+
<a class='story-card-link' href={`/story/${props.id}`}>
|
|
85
|
+
<div class='story-card-img-box'>
|
|
86
|
+
<img class='story-card-img' src={props.cover_file} />
|
|
87
|
+
<div class='story-card-img-tips'>
|
|
88
|
+
<span class='view_count'>
|
|
89
|
+
<Icon name={icons.eye} /> {props.view_count}
|
|
90
|
+
</span>{' '}
|
|
91
|
+
<span class='collect_count'>
|
|
92
|
+
<Icon name={icons.heart} /> {props.collect_count}
|
|
93
|
+
</span>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
<div class='story-card-row story-card-title'>
|
|
97
|
+
<span class='title'>{props.title}</span>
|
|
98
|
+
</div>
|
|
99
|
+
</a>
|
|
100
|
+
<div class='story-card-row story-card-info'>
|
|
101
|
+
<span class='author'>{props.author}</span>
|
|
102
|
+
</div>
|
|
103
|
+
</section>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { createSignal, CssProps, For, adjustedMediaQueryRange, MediaQueryDirection, MediaQueryRange } from 'lupine.web';
|
|
2
|
+
import { StoryCardShortProps } from './story-props';
|
|
3
|
+
import { StoryCard } from './story-card';
|
|
4
|
+
|
|
5
|
+
export type StoryListComponentProps = {
|
|
6
|
+
items: StoryCardShortProps[];
|
|
7
|
+
count: number;
|
|
8
|
+
management: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const StoryListComponent = (props: StoryListComponentProps) => {
|
|
12
|
+
const [items, setItems] = createSignal(props.items);
|
|
13
|
+
const maxWidth = '1399px';
|
|
14
|
+
const css: CssProps = {
|
|
15
|
+
alignSelf: 'center',
|
|
16
|
+
paddingBottom: '16px',
|
|
17
|
+
clear: 'both',
|
|
18
|
+
width: '100%',
|
|
19
|
+
'.story-list-inner': {
|
|
20
|
+
// display: 'grid',
|
|
21
|
+
// gridGap: '10px',
|
|
22
|
+
// gridAutoRows: 'auto',
|
|
23
|
+
// gridTemplateColumns: 'repeat(5, 1fr)',
|
|
24
|
+
columnCount: 5,
|
|
25
|
+
columnGap: '10px',
|
|
26
|
+
// display: 'flex',
|
|
27
|
+
// flexWrap: 'wrap',
|
|
28
|
+
maxWidth: '100%',
|
|
29
|
+
width: '100%',
|
|
30
|
+
// padding: '0 16px',
|
|
31
|
+
margin: 'auto',
|
|
32
|
+
// placeContent: 'space-between',
|
|
33
|
+
'.story-list-sub': {
|
|
34
|
+
// width: 'calc(25% - 10.7px)', // (16 + 16) / 3
|
|
35
|
+
width: '100%',
|
|
36
|
+
overflow: 'hidden',
|
|
37
|
+
// paddingTop: '16px',
|
|
38
|
+
},
|
|
39
|
+
'.card-list-sub-box': {
|
|
40
|
+
borderRadius: '6px',
|
|
41
|
+
// border: 'dotted 1px gray',
|
|
42
|
+
padding: '8px',
|
|
43
|
+
},
|
|
44
|
+
[adjustedMediaQueryRange(MediaQueryDirection.Above, maxWidth || '', 32)]: {
|
|
45
|
+
padding: '0',
|
|
46
|
+
},
|
|
47
|
+
[MediaQueryRange.DesktopAbove]: {
|
|
48
|
+
'.story-list-sub:nth-child(3n+1), .story-list-sub:nth-child(3n+2)': {
|
|
49
|
+
marginRight: '16px',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
// [MediaQueryRange.DesktopAbove]: {
|
|
53
|
+
// '.card-list-sub:nth-child(3n+1) .card-list-sub-box, .card-list-sub:nth-child(3n+2) .card-list-sub-box': {
|
|
54
|
+
// marginRight: '16px',
|
|
55
|
+
// },
|
|
56
|
+
// },
|
|
57
|
+
[MediaQueryRange.DesktopBelow]: {
|
|
58
|
+
columnCount: 4,
|
|
59
|
+
// gridTemplateColumns: 'repeat(4, 1fr)',
|
|
60
|
+
'.story-list-sub': {
|
|
61
|
+
// width: 'calc(33.33% - 10.7px)', // (16 + 16) / 3
|
|
62
|
+
},
|
|
63
|
+
'.story-list-sub:nth-child(2n+1)': {
|
|
64
|
+
marginRight: '16px',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
[MediaQueryRange.MobileBelow]: {
|
|
68
|
+
columnCount: 3,
|
|
69
|
+
// gridTemplateColumns: 'repeat(3, 1fr)',
|
|
70
|
+
'.story-list-sub': {
|
|
71
|
+
// width: 'calc(50% - 8px)',
|
|
72
|
+
},
|
|
73
|
+
'.story-list-sub:nth-child(2n+1)': {
|
|
74
|
+
marginRight: '16px',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
[MediaQueryRange.ExtraSmallBelow]: {
|
|
78
|
+
columnCount: 2,
|
|
79
|
+
// gridTemplateColumns: 'repeat(2, 1fr)',
|
|
80
|
+
// padding: '0 16px',
|
|
81
|
+
'.story-list-sub': {
|
|
82
|
+
// width: '100%',
|
|
83
|
+
marginRight: '0!important',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
return (
|
|
89
|
+
<section css={css} className='story-list-box'>
|
|
90
|
+
<div class='story-list-inner'>
|
|
91
|
+
<For each={items}>
|
|
92
|
+
{(item) => (
|
|
93
|
+
<div class='story-list-sub'>
|
|
94
|
+
<StoryCard
|
|
95
|
+
{...item}
|
|
96
|
+
management={props.management}
|
|
97
|
+
onDeleted={() => setItems(items().filter((i) => i !== item))}
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
)}
|
|
101
|
+
</For>
|
|
102
|
+
</div>
|
|
103
|
+
</section>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type StoryCardProps = {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
music_url: string;
|
|
5
|
+
cover_url: string;
|
|
6
|
+
video_url?: string;
|
|
7
|
+
author: string;
|
|
8
|
+
view_count: number;
|
|
9
|
+
download_count: number;
|
|
10
|
+
collect_count: number;
|
|
11
|
+
labels: string[];
|
|
12
|
+
group_labels: string[];
|
|
13
|
+
upload_date: string;
|
|
14
|
+
start_time_seconds: number;
|
|
15
|
+
state: string;
|
|
16
|
+
remark: string;
|
|
17
|
+
updatedstamp: string;
|
|
18
|
+
};
|
|
19
|
+
export type StoryCardShortProps = {
|
|
20
|
+
id: number;
|
|
21
|
+
title: string;
|
|
22
|
+
cover_file: string;
|
|
23
|
+
author: string;
|
|
24
|
+
view_count: number;
|
|
25
|
+
download_count: number;
|
|
26
|
+
collect_count: number;
|
|
27
|
+
start_time_seconds: number;
|
|
28
|
+
management: boolean;
|
|
29
|
+
onDeleted?: () => void;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type StoryListProps = {
|
|
33
|
+
item: StoryCardShortProps;
|
|
34
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html data-theme="<!--META-THEME-->">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<link rel="manifest" href="/assets/site.webmanifest" />
|
|
6
|
+
<title><!--META-TITLE--></title>
|
|
7
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png" />
|
|
8
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png" />
|
|
9
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png" />
|
|
10
|
+
<link rel="icon" type="image/png" sizes="192x192" href="/assets/android-chrome-192x192.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<!--META-ENV-START-->
|
|
13
|
+
<!--META-ENV-END-->
|
|
14
|
+
<link rel="shortcut icon" href="/assets/favicon.ico?t={hash}" type="image/x-icon" />
|
|
15
|
+
<!-- the icons of the pages of lupine.api (ifc-icon): a font made with web/icons-font.config.js -->
|
|
16
|
+
<link rel="stylesheet" type="text/css" href="/assets/icons-font/style.css?t={hash}" />
|
|
17
|
+
<link rel="stylesheet" type="text/css" href="{SUBDIR}/index.css?t={hash}" />
|
|
18
|
+
<script defer src="{SUBDIR}/index.js?t={hash}"></script>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<div class="lupine-root"></div>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// css order is important
|
|
2
|
+
import '../styles/global.css';
|
|
3
|
+
|
|
4
|
+
import { adminFrameHelper, devAdminPageRouter } from 'lupine.api/admin';
|
|
5
|
+
import { bindAppGlobalStyle, bindRenderPageFunctions, bindRouter, bindTheme, PageProps, PageRouter, setDefaultPageTitle, Redirect } from 'lupine.web';
|
|
6
|
+
import { DemoPage } from 'lupine.web.components/demo';
|
|
7
|
+
import { themes } from '../styles/theme';
|
|
8
|
+
import { baseCss } from '../styles/base-css';
|
|
9
|
+
import { baseUrl, fetchData } from '../services/fetch-data';
|
|
10
|
+
import { patchAdminFrame } from './admin-patch';
|
|
11
|
+
|
|
12
|
+
// The admin pages (/admin, in the browser only), an entry of its own (lupine.json). One page for both: an admin of the
|
|
13
|
+
// app (signed in in the app, or here) sees the pages of the site (Site: items, users, the website); the developer
|
|
14
|
+
// (DEV_ADMIN_USER / DEV_ADMIN_PASS of .env) sees the tools too: the database, logs, files, the server, releases,
|
|
15
|
+
// settings. /admin/demo: the examples of all the components.
|
|
16
|
+
|
|
17
|
+
export const checkDevAndAppAuth = async (props: PageProps) => {
|
|
18
|
+
adminFrameHelper.setIsDevAdmin(false);
|
|
19
|
+
if (typeof document === 'undefined') {
|
|
20
|
+
// no ssr for admin pages
|
|
21
|
+
return <div></div>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const data = await props.renderPageFunctions.fetchData('/api/admin/auth');
|
|
25
|
+
if (data && data.json && data.json.devLogin) {
|
|
26
|
+
adminFrameHelper.setIsDevAdmin(true);
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
// an admin of the app (the API checks it again for each request)
|
|
30
|
+
if (data && data.json && data.json.appLogin && data.json.user && data.json.user.admin === '1') {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
if (props.url !== '/admin/login') {
|
|
34
|
+
return Redirect({ url: '/admin/login' });
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
};
|
|
38
|
+
bindTheme('light', themes);
|
|
39
|
+
bindAppGlobalStyle('comm-css', baseCss, false, true);
|
|
40
|
+
setDefaultPageTitle('Lupine Full-stack Starter - admin');
|
|
41
|
+
|
|
42
|
+
bindRenderPageFunctions({ fetchData, baseUrl });
|
|
43
|
+
|
|
44
|
+
patchAdminFrame();
|
|
45
|
+
const pageRouter = new PageRouter();
|
|
46
|
+
devAdminPageRouter.setFilter(checkDevAndAppAuth);
|
|
47
|
+
pageRouter.use('/admin/demo', DemoPage);
|
|
48
|
+
pageRouter.use('/admin', devAdminPageRouter);
|
|
49
|
+
bindRouter(pageRouter);
|