@akanjs/cli 0.9.4 → 0.9.6

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 (41) hide show
  1. package/cjs/index.js +11 -16
  2. package/cjs/src/templates/app/package.json.template +5 -0
  3. package/cjs/src/templates/app/postcss.config.js.template +2 -4
  4. package/cjs/src/templates/app/{app/[lang]/(__appName__)/(public)/privacy/page.js → ui/UiComponent.js} +12 -19
  5. package/cjs/src/templates/app/ui/index.js +2 -3
  6. package/cjs/src/templates/libRoot/package.json.template +1 -0
  7. package/cjs/src/templates/module/__Model__.Template.js +1 -2
  8. package/cjs/src/templates/module/__model__.constant.js +2 -7
  9. package/esm/index.js +11 -16
  10. package/esm/src/templates/app/package.json.template +5 -0
  11. package/esm/src/templates/app/postcss.config.js.template +2 -4
  12. package/esm/src/templates/app/ui/UiComponent.js +15 -0
  13. package/esm/src/templates/app/ui/index.js +2 -3
  14. package/esm/src/templates/libRoot/package.json.template +1 -0
  15. package/esm/src/templates/module/__Model__.Template.js +1 -2
  16. package/esm/src/templates/module/__model__.constant.js +2 -7
  17. package/package.json +1 -1
  18. package/src/module/module.command.d.ts +1 -1
  19. package/src/templates/app/{app/[lang]/(__appName__)/(user)/self/page.d.ts → ui/UiComponent.d.ts} +1 -4
  20. package/cjs/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.js +0 -47
  21. package/cjs/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.js +0 -50
  22. package/cjs/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.js +0 -41
  23. package/cjs/src/templates/app/app/[lang]/(__appName__)/(user)/layout.js +0 -43
  24. package/cjs/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.js +0 -60
  25. package/cjs/src/templates/app/ui/Footer.js +0 -67
  26. package/cjs/src/templates/app/ui/MainHeader.js +0 -131
  27. package/esm/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.js +0 -27
  28. package/esm/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.js +0 -22
  29. package/esm/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.js +0 -30
  30. package/esm/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.js +0 -21
  31. package/esm/src/templates/app/app/[lang]/(__appName__)/(user)/layout.js +0 -23
  32. package/esm/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.js +0 -40
  33. package/esm/src/templates/app/ui/Footer.js +0 -47
  34. package/esm/src/templates/app/ui/MainHeader.js +0 -111
  35. package/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.d.ts +0 -9
  36. package/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.d.ts +0 -9
  37. package/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.d.ts +0 -9
  38. package/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.d.ts +0 -10
  39. package/src/templates/app/app/[lang]/(__appName__)/(user)/layout.d.ts +0 -9
  40. package/src/templates/app/ui/Footer.d.ts +0 -9
  41. package/src/templates/app/ui/MainHeader.d.ts +0 -10
package/cjs/index.js CHANGED
@@ -725,12 +725,9 @@ var makeAppConfig = (config, props) => {
725
725
  backend: {
726
726
  dockerfile: config.backend?.dockerfile ?? `FROM node:22-slim
727
727
  RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
728
- RUN apt-get update && apt-get upgrade -y
729
- RUN apt-get install -y ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils udev ffmpeg
728
+ RUN apt-get update && apt-get upgrade -y && apt-get install -y git redis build-essential python3 ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils udev ffmpeg && rm -rf /var/lib/apt/lists/*
730
729
  ARG TARGETARCH
731
730
  RUN if [ "$TARGETARCH" = "amd64" ]; then wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian92-x86_64-100.3.1.deb && apt-get install -y ./mongodb-database-tools-*.deb && rm -f mongodb-database-tools-*.deb; fi
732
- RUN apt-get install -y git redis build-essential python3
733
- RUN rm -rf /var/lib/apt/lists/*
734
731
  RUN mkdir -p /workspace
735
732
  WORKDIR /workspace
736
733
  COPY ./package.json ./package.json
@@ -4018,8 +4015,13 @@ var ApplicationScript = class {
4018
4015
  spinner.succeed(`Backend built in dist/apps/${app.name}/backend`);
4019
4016
  }
4020
4017
  async startBackend(app, { open: open2 = false, dbup = true, sync = true } = {}) {
4021
- if (app.getEnv() === "local" && dbup)
4018
+ if (app.getEnv() === "local" && dbup) {
4022
4019
  await this.dbup(app.workspace);
4020
+ process.on("SIGINT", async () => {
4021
+ await this.dbdown(app.workspace);
4022
+ process.exit(0);
4023
+ });
4024
+ }
4023
4025
  if (sync)
4024
4026
  await this.syncApplication(app);
4025
4027
  const spinner = app.spinning("Preparing backend...");
@@ -5236,13 +5238,9 @@ var ModuleScript = class {
5236
5238
  // pkgs/@akanjs/cli/src/module/module.command.ts
5237
5239
  var ModuleCommand = class {
5238
5240
  moduleScript = new ModuleScript();
5239
- async createModule(sys3, moduleName, description, schemaDescription, ai) {
5241
+ async createModule(moduleName, sys3) {
5240
5242
  const name = lowerlize(moduleName.replace(/ /g, ""));
5241
- if (ai) {
5242
- await this.moduleScript.createModule(sys3, name, description, schemaDescription);
5243
- } else {
5244
- await this.moduleScript.createModuleTemplate(sys3, name);
5245
- }
5243
+ await this.moduleScript.createModuleTemplate(sys3, name);
5246
5244
  }
5247
5245
  removeModule(module2) {
5248
5246
  this.moduleScript.removeModule(module2);
@@ -5259,11 +5257,8 @@ var ModuleCommand = class {
5259
5257
  };
5260
5258
  __decorateClass([
5261
5259
  Target.Public(),
5262
- __decorateParam(0, Sys()),
5263
- __decorateParam(1, Argument("moduleName", { desc: "name of module" })),
5264
- __decorateParam(2, Option("description", { desc: "description of module" })),
5265
- __decorateParam(3, Option("schemaDescription", { desc: "schema description of module" })),
5266
- __decorateParam(4, Option("ai", { type: "boolean", default: false, desc: "use ai to create module" }))
5260
+ __decorateParam(0, Argument("moduleName", { desc: "name of module" })),
5261
+ __decorateParam(1, Sys())
5267
5262
  ], ModuleCommand.prototype, "createModule", 1);
5268
5263
  __decorateClass([
5269
5264
  Target.Public(),
@@ -0,0 +1,5 @@
1
+ {
2
+ "type": "module",
3
+ "name": "@<%= appName %>",
4
+ "version": "0.0.1"
5
+ }
@@ -1,10 +1,8 @@
1
- //! will be replaced with akan.config.ts
2
- const akanjsPrefix = process.env.USE_AKANJS_PKGS === "true" ? "../../pkgs/" : "";
3
- const { withBase } = require(`${akanjsPrefix}@akanjs/config/postcss.config.base`);
1
+ import { withBase } from "@akanjs/config/postcss.config.base";
4
2
 
5
3
  /**
6
4
  * @type {import('postcss-load-config').Config}
7
5
  */
8
6
  const config = {};
9
7
 
10
- module.exports = withBase(config);
8
+ export default withBase(config);
@@ -16,27 +16,20 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.tsx
20
- var page_exports = {};
21
- __export(page_exports, {
19
+ // pkgs/@akanjs/cli/src/templates/app/ui/UiComponent.ts
20
+ var UiComponent_exports = {};
21
+ __export(UiComponent_exports, {
22
22
  default: () => getContent
23
23
  });
24
- module.exports = __toCommonJS(page_exports);
24
+ module.exports = __toCommonJS(UiComponent_exports);
25
25
  function getContent(scanResult, dict) {
26
- return {
27
- filename: "page.tsx",
28
- content: `
29
- import { Inform } from "@util/ui";
26
+ return `
27
+ // This is a Sample UI component that can be used in the app.
28
+ // You can use it by \`import { UiComponent } from "@${dict.appName}/ui";\` in the page or other components.
29
+ // File name and export name should be same, because of modularizedImport feature of Next.js.
30
30
 
31
- export default function Page() {
32
- return (
33
- <div className="container whitespace-pre-wrap">
34
- <h1 className="flex justify-center">Privacy Policy</h1>
35
- <Inform.PrivacyPolicy companyName="${dict.CompanyName}" />
36
- </div>
37
- );
38
- }
39
-
40
- `
41
- };
31
+ export const UiComponent = () => {
32
+ return <div>UiComponent</div>;
33
+ };
34
+ `;
42
35
  }
@@ -24,7 +24,6 @@ __export(ui_exports, {
24
24
  module.exports = __toCommonJS(ui_exports);
25
25
  function getContent(scanResult, dict = {}) {
26
26
  return `
27
- export { MainHeader } from "./MainHeader";
28
- export { Footer } from "./Footer";
29
- `;
27
+ export { UiComponent } from "./UiComponent";
28
+ `;
30
29
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "type": "module",
2
3
  "name": "@<%= libName %>",
3
4
  "version": "0.0.1"
4
5
  }
@@ -28,8 +28,7 @@ function getContent(scanResult, dict) {
28
28
  content: `
29
29
  "use client";
30
30
  import { cnst, st, usePage } from "@${dict.sysName}/client";
31
- import { Field } from "@shared/ui";
32
- import { Layout } from "@akanjs/ui";
31
+ import { Layout, Field } from "@akanjs/ui";
33
32
 
34
33
  interface ${dict.Model}EditProps {
35
34
  ${dict.model}Id?: string | null;
@@ -43,10 +43,7 @@ export class ${dict.Model}Object extends via(${dict.Model}Input) {
43
43
  }
44
44
 
45
45
  @Model.Light("Light${dict.Model}")
46
- export class Light${dict.Model} extends via(${dict.Model}Object, [
47
- "field",
48
- "status",
49
- ] as const) {}
46
+ export class Light${dict.Model} extends via(${dict.Model}Object, ["status"] as const) {}
50
47
 
51
48
  @Model.Full("${dict.Model}")
52
49
  export class ${dict.Model} extends via(${dict.Model}Object, Light${dict.Model}) {}
@@ -69,9 +66,7 @@ export class ${dict.Model}Filter extends sortOf(${dict.Model}, {}) {
69
66
  inStatus(
70
67
  @Filter.Arg("status", () => String) status: ${dict.Model}Status,
71
68
  ) {
72
- return {
73
- status,
74
- };
69
+ return { status };
75
70
  }
76
71
  }
77
72
  `;
package/esm/index.js CHANGED
@@ -712,12 +712,9 @@ var makeAppConfig = (config, props) => {
712
712
  backend: {
713
713
  dockerfile: config.backend?.dockerfile ?? `FROM node:22-slim
714
714
  RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
715
- RUN apt-get update && apt-get upgrade -y
716
- RUN apt-get install -y ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils udev ffmpeg
715
+ RUN apt-get update && apt-get upgrade -y && apt-get install -y git redis build-essential python3 ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils udev ffmpeg && rm -rf /var/lib/apt/lists/*
717
716
  ARG TARGETARCH
718
717
  RUN if [ "$TARGETARCH" = "amd64" ]; then wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian92-x86_64-100.3.1.deb && apt-get install -y ./mongodb-database-tools-*.deb && rm -f mongodb-database-tools-*.deb; fi
719
- RUN apt-get install -y git redis build-essential python3
720
- RUN rm -rf /var/lib/apt/lists/*
721
718
  RUN mkdir -p /workspace
722
719
  WORKDIR /workspace
723
720
  COPY ./package.json ./package.json
@@ -4010,8 +4007,13 @@ var ApplicationScript = class {
4010
4007
  spinner.succeed(`Backend built in dist/apps/${app.name}/backend`);
4011
4008
  }
4012
4009
  async startBackend(app, { open: open2 = false, dbup = true, sync = true } = {}) {
4013
- if (app.getEnv() === "local" && dbup)
4010
+ if (app.getEnv() === "local" && dbup) {
4014
4011
  await this.dbup(app.workspace);
4012
+ process.on("SIGINT", async () => {
4013
+ await this.dbdown(app.workspace);
4014
+ process.exit(0);
4015
+ });
4016
+ }
4015
4017
  if (sync)
4016
4018
  await this.syncApplication(app);
4017
4019
  const spinner = app.spinning("Preparing backend...");
@@ -5228,13 +5230,9 @@ var ModuleScript = class {
5228
5230
  // pkgs/@akanjs/cli/src/module/module.command.ts
5229
5231
  var ModuleCommand = class {
5230
5232
  moduleScript = new ModuleScript();
5231
- async createModule(sys3, moduleName, description, schemaDescription, ai) {
5233
+ async createModule(moduleName, sys3) {
5232
5234
  const name = lowerlize(moduleName.replace(/ /g, ""));
5233
- if (ai) {
5234
- await this.moduleScript.createModule(sys3, name, description, schemaDescription);
5235
- } else {
5236
- await this.moduleScript.createModuleTemplate(sys3, name);
5237
- }
5235
+ await this.moduleScript.createModuleTemplate(sys3, name);
5238
5236
  }
5239
5237
  removeModule(module) {
5240
5238
  this.moduleScript.removeModule(module);
@@ -5251,11 +5249,8 @@ var ModuleCommand = class {
5251
5249
  };
5252
5250
  __decorateClass([
5253
5251
  Target.Public(),
5254
- __decorateParam(0, Sys()),
5255
- __decorateParam(1, Argument("moduleName", { desc: "name of module" })),
5256
- __decorateParam(2, Option("description", { desc: "description of module" })),
5257
- __decorateParam(3, Option("schemaDescription", { desc: "schema description of module" })),
5258
- __decorateParam(4, Option("ai", { type: "boolean", default: false, desc: "use ai to create module" }))
5252
+ __decorateParam(0, Argument("moduleName", { desc: "name of module" })),
5253
+ __decorateParam(1, Sys())
5259
5254
  ], ModuleCommand.prototype, "createModule", 1);
5260
5255
  __decorateClass([
5261
5256
  Target.Public(),
@@ -0,0 +1,5 @@
1
+ {
2
+ "type": "module",
3
+ "name": "@<%= appName %>",
4
+ "version": "0.0.1"
5
+ }
@@ -1,10 +1,8 @@
1
- //! will be replaced with akan.config.ts
2
- const akanjsPrefix = process.env.USE_AKANJS_PKGS === "true" ? "../../pkgs/" : "";
3
- const { withBase } = require(`${akanjsPrefix}@akanjs/config/postcss.config.base`);
1
+ import { withBase } from "@akanjs/config/postcss.config.base";
4
2
 
5
3
  /**
6
4
  * @type {import('postcss-load-config').Config}
7
5
  */
8
6
  const config = {};
9
7
 
10
- module.exports = withBase(config);
8
+ export default withBase(config);
@@ -0,0 +1,15 @@
1
+ // pkgs/@akanjs/cli/src/templates/app/ui/UiComponent.ts
2
+ function getContent(scanResult, dict) {
3
+ return `
4
+ // This is a Sample UI component that can be used in the app.
5
+ // You can use it by \`import { UiComponent } from "@${dict.appName}/ui";\` in the page or other components.
6
+ // File name and export name should be same, because of modularizedImport feature of Next.js.
7
+
8
+ export const UiComponent = () => {
9
+ return <div>UiComponent</div>;
10
+ };
11
+ `;
12
+ }
13
+ export {
14
+ getContent as default
15
+ };
@@ -1,9 +1,8 @@
1
1
  // pkgs/@akanjs/cli/src/templates/app/ui/index.ts
2
2
  function getContent(scanResult, dict = {}) {
3
3
  return `
4
- export { MainHeader } from "./MainHeader";
5
- export { Footer } from "./Footer";
6
- `;
4
+ export { UiComponent } from "./UiComponent";
5
+ `;
7
6
  }
8
7
  export {
9
8
  getContent as default
@@ -1,4 +1,5 @@
1
1
  {
2
+ "type": "module",
2
3
  "name": "@<%= libName %>",
3
4
  "version": "0.0.1"
4
5
  }
@@ -5,8 +5,7 @@ function getContent(scanResult, dict) {
5
5
  content: `
6
6
  "use client";
7
7
  import { cnst, st, usePage } from "@${dict.sysName}/client";
8
- import { Field } from "@shared/ui";
9
- import { Layout } from "@akanjs/ui";
8
+ import { Layout, Field } from "@akanjs/ui";
10
9
 
11
10
  interface ${dict.Model}EditProps {
12
11
  ${dict.model}Id?: string | null;
@@ -20,10 +20,7 @@ export class ${dict.Model}Object extends via(${dict.Model}Input) {
20
20
  }
21
21
 
22
22
  @Model.Light("Light${dict.Model}")
23
- export class Light${dict.Model} extends via(${dict.Model}Object, [
24
- "field",
25
- "status",
26
- ] as const) {}
23
+ export class Light${dict.Model} extends via(${dict.Model}Object, ["status"] as const) {}
27
24
 
28
25
  @Model.Full("${dict.Model}")
29
26
  export class ${dict.Model} extends via(${dict.Model}Object, Light${dict.Model}) {}
@@ -46,9 +43,7 @@ export class ${dict.Model}Filter extends sortOf(${dict.Model}, {}) {
46
43
  inStatus(
47
44
  @Filter.Arg("status", () => String) status: ${dict.Model}Status,
48
45
  ) {
49
- return {
50
- status,
51
- };
46
+ return { status };
52
47
  }
53
48
  }
54
49
  `;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sourceType": "module",
3
3
  "name": "@akanjs/cli",
4
- "version": "0.9.4",
4
+ "version": "0.9.6",
5
5
  "bin": {
6
6
  "akan": "cjs/index.js"
7
7
  },
@@ -2,7 +2,7 @@ import { Module, Sys } from "@akanjs/devkit";
2
2
  import { ModuleScript } from "./module.script";
3
3
  export declare class ModuleCommand {
4
4
  moduleScript: ModuleScript;
5
- createModule(sys: Sys, moduleName: string, description: string, schemaDescription: string, ai: boolean): Promise<void>;
5
+ createModule(moduleName: string, sys: Sys): Promise<void>;
6
6
  removeModule(module: Module): void;
7
7
  createView(module: Module): Promise<void>;
8
8
  createUnit(module: Module): Promise<void>;
@@ -2,8 +2,5 @@ import type { AppScanResult, LibScanResult } from "@akanjs/config";
2
2
  interface Dict {
3
3
  appName: string;
4
4
  }
5
- export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
6
- filename: string;
7
- content: string;
8
- };
5
+ export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): string;
9
6
  export {};
@@ -1,47 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.tsx
20
- var page_exports = {};
21
- __export(page_exports, {
22
- default: () => getContent
23
- });
24
- module.exports = __toCommonJS(page_exports);
25
- function getContent(scanResult, dict = {}) {
26
- return {
27
- filename: "page.tsx",
28
- content: `
29
- import { Image, Link } from "@akanjs/ui";
30
- import { User } from "@shared/client";
31
-
32
- export default function Page() {
33
- return (
34
- <div className="relative w-full h-screen overflow-hidden flex items-center justify-center">
35
- <div className="z-10 md:w-[400px] px-12 pt-12 pb-4 shadow-lg rounded-xl bg-base-100/50 backdrop-blur-xs">
36
- <User.Util.ForgotPassword />
37
- <Link.Back className="text-center">
38
- <button className="mt-2 underline btn btn-ghost">Back</button>
39
- </Link.Back>
40
- </div>
41
- <Image className="absolute left-0 right-0 top-0 bottom-0 -z-50" width={1920} height={1080} src="/back.jpg" />
42
- </div>
43
- );
44
- }
45
- `
46
- };
47
- }
@@ -1,50 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.tsx
20
- var page_exports = {};
21
- __export(page_exports, {
22
- default: () => getContent
23
- });
24
- module.exports = __toCommonJS(page_exports);
25
- function getContent(scanResult, dict) {
26
- return {
27
- filename: "page.tsx",
28
- content: `
29
- import { Image } from "@akanjs/ui";
30
- import { User } from "@shared/client";
31
- import { getSelf, router } from "@akanjs/client";
32
-
33
- export default function Page() {
34
- const self = getSelf();
35
- return (
36
- <div className="relative w-full h-screen overflow-hidden flex items-center justify-center">
37
- <div className="max-w-md bg-base-100/50 shadow-lg rounded-xl backdrop-blur-xs w-full py-4 pb-10 px-16">
38
- <div className="my-6 flex justify-center text-4xl">${dict.appName}</div>
39
- <User.Util.SignInPassword
40
- siteKey=""
41
- redirect="/self"
42
- signupHref={null}
43
- />
44
- </div>
45
- </div>
46
- );
47
- }
48
- `
49
- };
50
- }
@@ -1,41 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.tsx
20
- var page_exports = {};
21
- __export(page_exports, {
22
- default: () => getContent
23
- });
24
- module.exports = __toCommonJS(page_exports);
25
- function getContent(scanResult, dict) {
26
- return {
27
- filename: "page.tsx",
28
- content: `
29
- import { Inform } from "@util/ui";
30
-
31
- export default function Page() {
32
- return (
33
- <div className="container">
34
- <h1 className="flex justify-center">Terms of Service</h1>
35
- <Inform.ServicePolicy companyName="${dict.CompanyName}" serviceName="${dict.AppName}" />
36
- </div>
37
- );
38
- }
39
- `
40
- };
41
- }
@@ -1,43 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(user)/layout.tsx
20
- var layout_exports = {};
21
- __export(layout_exports, {
22
- default: () => getContent
23
- });
24
- module.exports = __toCommonJS(layout_exports);
25
- function getContent(scanResult, dict) {
26
- return {
27
- filename: "layout.tsx",
28
- content: `
29
- import { Footer } from "@${dict.appName}/ui";
30
- import { getSelf } from "@akanjs/client";
31
-
32
- export default function Layout({ children }: any) {
33
- getSelf({ unauthorize: "/signin" });
34
- return (
35
- <>
36
- <div className="w-full min-h-screen pt-20 px-2 container flex flex-col gap-2">{children}</div>
37
- <Footer />
38
- </>
39
- );
40
- }
41
- `
42
- };
43
- }
@@ -1,60 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.tsx
20
- var page_exports = {};
21
- __export(page_exports, {
22
- default: () => getContent
23
- });
24
- module.exports = __toCommonJS(page_exports);
25
- function getContent(scanResult, dict) {
26
- return {
27
- filename: "page.tsx",
28
- content: `
29
- import { User as SharedUser } from "@shared/client";
30
- import { MainHeader } from "@${dict.appName}/ui";
31
- import { User } from "@${dict.appName}/client";
32
- import { getSelf } from "@akanjs/client";
33
-
34
- export default function Page() {
35
- const self = getSelf({ unauthorize: "/signin" });
36
- return (
37
- <>
38
- <MainHeader items={[{ type: "self", name: "profile" }]} />
39
- <div className="flex items-center gap-2">
40
- <div className="text-2xl">My Profile</div>
41
- <User.Util.EditSelf />
42
- </div>
43
- <div>
44
- <User.Zone.Self />
45
- </div>
46
- <div>
47
- <div className="font-bold">Password</div>
48
- <div>
49
- *******
50
- <span>
51
- <SharedUser.Util.SetPasswordWithPhone />
52
- </span>
53
- </div>
54
- </div>
55
- </>
56
- );
57
- }
58
- `
59
- };
60
- }
@@ -1,67 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // pkgs/@akanjs/cli/src/templates/app/ui/Footer.tsx
20
- var Footer_exports = {};
21
- __export(Footer_exports, {
22
- default: () => getContent
23
- });
24
- module.exports = __toCommonJS(Footer_exports);
25
- function getContent(scanResult, dict) {
26
- return {
27
- filename: "Footer.tsx",
28
- content: `
29
- import { Image, Link } from "@akanjs/ui";
30
-
31
- export const Footer = () => {
32
- return (
33
- <div className="relative justify-center px-2 pb-12 mt-12 bg-[#f3f3f3] via-secondary-focus to-accent-focus">
34
- <div className="container py-10">
35
- <div className="justify-between mt-6 md:flex md:mt-10 sm:mt-0">
36
- <Link href="/" disabled>
37
- <Image src="/logo.svg" className="object-contain fill-black" width={200} height={36} />
38
- </Link>
39
- <div className="flex gap-4 mt-6 text-xs md:mt-0 md:text-base ">
40
- <Link href="/termsofservice">
41
- <span className="text-[#777777]">\uC774\uC6A9\uC57D\uAD00</span>
42
- </Link>
43
- <Link href="/privacy">
44
- <span className="text-[#777777]">\uAC1C\uC778\uC815\uBCF4\uCC98\uB9AC\uBC29\uCE68</span>
45
- </Link>
46
- </div>
47
- </div>
48
- <div className="items-center justify-between mt-6 text-sm md:text-base md:mt-3 md:flex ">
49
- <div className="flex flex-col text-xs md:text-base gap-1 text-[#777777]">
50
- ${dict.CompanyName} | CEO_NAME | COMPANY_ADDRESS
51
- </div>
52
- <div>
53
- <div className="flex gap-4 mt-6 text-xs md:text-base md:mt-0">
54
- <span className="text-[#777]">\uBB38\uC758</span>
55
- <a href="mailto:support@example.com">
56
- <span className="text-[#777]">support@example.com</span>
57
- </a>
58
- </div>
59
- </div>
60
- </div>
61
- </div>
62
- </div>
63
- );
64
- };
65
- `
66
- };
67
- }
@@ -1,131 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // pkgs/@akanjs/cli/src/templates/app/ui/MainHeader.tsx
20
- var MainHeader_exports = {};
21
- __export(MainHeader_exports, {
22
- default: () => getContent
23
- });
24
- module.exports = __toCommonJS(MainHeader_exports);
25
- function getContent(scanResult, dict) {
26
- return {
27
- filename: "MainHeader.tsx",
28
- content: `
29
- import { usePage } from "@${dict.appName}/client";
30
- import {
31
- AiOutlineBuild,
32
- AiOutlineEdit,
33
- AiOutlineHome,
34
- AiOutlinePoweroff,
35
- AiOutlinePrinter,
36
- AiOutlineRobot,
37
- AiOutlineSecurityScan,
38
- AiOutlineSend,
39
- AiOutlineUser,
40
- AiOutlineWindows,
41
- } from "react-icons/ai";
42
- import { User } from "@shared/client";
43
- import { Layout, Link } from "@akanjs/ui";
44
- import { ReactNode } from "react";
45
- import { clsx } from "@akanjs/client";
46
-
47
- type DirType = "home" | "send" | "print" | "self";
48
-
49
- const iconMap: { [key in DirType]: ReactNode } = {
50
- home: <AiOutlineHome />,
51
- send: <AiOutlineSend />,
52
- print: <AiOutlinePrinter />,
53
- self: <AiOutlineUser />,
54
- };
55
-
56
- interface MainHeaderProps {
57
- className?: string;
58
- children?: any;
59
- items: {
60
- type: DirType;
61
- name: string;
62
- href?: string;
63
- }[];
64
- type?: "view" | "edit" | "new";
65
- }
66
- export const MainHeader = ({ className, children, items, type = "view" }: MainHeaderProps) => {
67
- const { l } = usePage();
68
- return (
69
- <Layout.Header
70
- className={clsx("fixed left-0 px-2 py-2 bg-base-100/50 backdrop-blur-sm flex items-center gap-2", className)}
71
- >
72
- <Layout.Sider>
73
- <div className="text-4xl font-lemonmilk w-full text-center my-8">${dict.AppName}</div>
74
- <ul className="menu p-4 w-full bg-base-200 text-base-content">
75
- {/* <li>
76
- <User.Zone.Profile/>
77
- </li> */}
78
- <li>
79
- <Link href="/location" className="flex gap-2 items-center text-lg">
80
- {iconMap.home} Home
81
- </Link>
82
- </li>
83
- <li>
84
- <Link href="/self" className="flex gap-2 items-center text-lg">
85
- {iconMap.self} My Profile
86
- </Link>
87
- </li>
88
- <li>
89
- <User.Util.Signout href="/" className="flex gap-2 items-center text-lg text-warning">
90
- <AiOutlinePoweroff /> Sign out
91
- </User.Util.Signout>
92
- </li>
93
- </ul>
94
- </Layout.Sider>
95
- <div className="text-sm breadcrumbs hidden md:block">
96
- <ul>
97
- {items.slice(0, -2).map(({ type, name, href }, idx) => (
98
- <li key={idx}>
99
- <Link className="flex gap-1 items-center" href={href}>
100
- {iconMap[type]} {name}
101
- </Link>
102
- </li>
103
- ))}
104
- <li></li>
105
- </ul>
106
- </div>
107
- <div className="text-sm breadcrumbs -ml-2">
108
- <ul>
109
- {items.slice(-2).map(({ type, name, href }, idx) => (
110
- <li key={idx}>
111
- <Link className="flex gap-1 items-center" href={href}>
112
- {iconMap[type]} {name}
113
- </Link>
114
- </li>
115
- ))}
116
- {type === "new" ? (
117
- <li>+ {l("shared.new")}</li>
118
- ) : type === "edit" ? (
119
- <li className="flex gap-1 items-center">
120
- <AiOutlineEdit /> {l("shared.edit")}
121
- </li>
122
- ) : null}
123
- </ul>
124
- </div>
125
- {children}
126
- </Layout.Header>
127
- );
128
- };
129
- `
130
- };
131
- }
@@ -1,27 +0,0 @@
1
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.tsx
2
- function getContent(scanResult, dict = {}) {
3
- return {
4
- filename: "page.tsx",
5
- content: `
6
- import { Image, Link } from "@akanjs/ui";
7
- import { User } from "@shared/client";
8
-
9
- export default function Page() {
10
- return (
11
- <div className="relative w-full h-screen overflow-hidden flex items-center justify-center">
12
- <div className="z-10 md:w-[400px] px-12 pt-12 pb-4 shadow-lg rounded-xl bg-base-100/50 backdrop-blur-xs">
13
- <User.Util.ForgotPassword />
14
- <Link.Back className="text-center">
15
- <button className="mt-2 underline btn btn-ghost">Back</button>
16
- </Link.Back>
17
- </div>
18
- <Image className="absolute left-0 right-0 top-0 bottom-0 -z-50" width={1920} height={1080} src="/back.jpg" />
19
- </div>
20
- );
21
- }
22
- `
23
- };
24
- }
25
- export {
26
- getContent as default
27
- };
@@ -1,22 +0,0 @@
1
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.tsx
2
- function getContent(scanResult, dict) {
3
- return {
4
- filename: "page.tsx",
5
- content: `
6
- import { Inform } from "@util/ui";
7
-
8
- export default function Page() {
9
- return (
10
- <div className="container whitespace-pre-wrap">
11
- <h1 className="flex justify-center">Privacy Policy</h1>
12
- <Inform.PrivacyPolicy companyName="${dict.CompanyName}" />
13
- </div>
14
- );
15
- }
16
-
17
- `
18
- };
19
- }
20
- export {
21
- getContent as default
22
- };
@@ -1,30 +0,0 @@
1
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.tsx
2
- function getContent(scanResult, dict) {
3
- return {
4
- filename: "page.tsx",
5
- content: `
6
- import { Image } from "@akanjs/ui";
7
- import { User } from "@shared/client";
8
- import { getSelf, router } from "@akanjs/client";
9
-
10
- export default function Page() {
11
- const self = getSelf();
12
- return (
13
- <div className="relative w-full h-screen overflow-hidden flex items-center justify-center">
14
- <div className="max-w-md bg-base-100/50 shadow-lg rounded-xl backdrop-blur-xs w-full py-4 pb-10 px-16">
15
- <div className="my-6 flex justify-center text-4xl">${dict.appName}</div>
16
- <User.Util.SignInPassword
17
- siteKey=""
18
- redirect="/self"
19
- signupHref={null}
20
- />
21
- </div>
22
- </div>
23
- );
24
- }
25
- `
26
- };
27
- }
28
- export {
29
- getContent as default
30
- };
@@ -1,21 +0,0 @@
1
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.tsx
2
- function getContent(scanResult, dict) {
3
- return {
4
- filename: "page.tsx",
5
- content: `
6
- import { Inform } from "@util/ui";
7
-
8
- export default function Page() {
9
- return (
10
- <div className="container">
11
- <h1 className="flex justify-center">Terms of Service</h1>
12
- <Inform.ServicePolicy companyName="${dict.CompanyName}" serviceName="${dict.AppName}" />
13
- </div>
14
- );
15
- }
16
- `
17
- };
18
- }
19
- export {
20
- getContent as default
21
- };
@@ -1,23 +0,0 @@
1
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(user)/layout.tsx
2
- function getContent(scanResult, dict) {
3
- return {
4
- filename: "layout.tsx",
5
- content: `
6
- import { Footer } from "@${dict.appName}/ui";
7
- import { getSelf } from "@akanjs/client";
8
-
9
- export default function Layout({ children }: any) {
10
- getSelf({ unauthorize: "/signin" });
11
- return (
12
- <>
13
- <div className="w-full min-h-screen pt-20 px-2 container flex flex-col gap-2">{children}</div>
14
- <Footer />
15
- </>
16
- );
17
- }
18
- `
19
- };
20
- }
21
- export {
22
- getContent as default
23
- };
@@ -1,40 +0,0 @@
1
- // pkgs/@akanjs/cli/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.tsx
2
- function getContent(scanResult, dict) {
3
- return {
4
- filename: "page.tsx",
5
- content: `
6
- import { User as SharedUser } from "@shared/client";
7
- import { MainHeader } from "@${dict.appName}/ui";
8
- import { User } from "@${dict.appName}/client";
9
- import { getSelf } from "@akanjs/client";
10
-
11
- export default function Page() {
12
- const self = getSelf({ unauthorize: "/signin" });
13
- return (
14
- <>
15
- <MainHeader items={[{ type: "self", name: "profile" }]} />
16
- <div className="flex items-center gap-2">
17
- <div className="text-2xl">My Profile</div>
18
- <User.Util.EditSelf />
19
- </div>
20
- <div>
21
- <User.Zone.Self />
22
- </div>
23
- <div>
24
- <div className="font-bold">Password</div>
25
- <div>
26
- *******
27
- <span>
28
- <SharedUser.Util.SetPasswordWithPhone />
29
- </span>
30
- </div>
31
- </div>
32
- </>
33
- );
34
- }
35
- `
36
- };
37
- }
38
- export {
39
- getContent as default
40
- };
@@ -1,47 +0,0 @@
1
- // pkgs/@akanjs/cli/src/templates/app/ui/Footer.tsx
2
- function getContent(scanResult, dict) {
3
- return {
4
- filename: "Footer.tsx",
5
- content: `
6
- import { Image, Link } from "@akanjs/ui";
7
-
8
- export const Footer = () => {
9
- return (
10
- <div className="relative justify-center px-2 pb-12 mt-12 bg-[#f3f3f3] via-secondary-focus to-accent-focus">
11
- <div className="container py-10">
12
- <div className="justify-between mt-6 md:flex md:mt-10 sm:mt-0">
13
- <Link href="/" disabled>
14
- <Image src="/logo.svg" className="object-contain fill-black" width={200} height={36} />
15
- </Link>
16
- <div className="flex gap-4 mt-6 text-xs md:mt-0 md:text-base ">
17
- <Link href="/termsofservice">
18
- <span className="text-[#777777]">\uC774\uC6A9\uC57D\uAD00</span>
19
- </Link>
20
- <Link href="/privacy">
21
- <span className="text-[#777777]">\uAC1C\uC778\uC815\uBCF4\uCC98\uB9AC\uBC29\uCE68</span>
22
- </Link>
23
- </div>
24
- </div>
25
- <div className="items-center justify-between mt-6 text-sm md:text-base md:mt-3 md:flex ">
26
- <div className="flex flex-col text-xs md:text-base gap-1 text-[#777777]">
27
- ${dict.CompanyName} | CEO_NAME | COMPANY_ADDRESS
28
- </div>
29
- <div>
30
- <div className="flex gap-4 mt-6 text-xs md:text-base md:mt-0">
31
- <span className="text-[#777]">\uBB38\uC758</span>
32
- <a href="mailto:support@example.com">
33
- <span className="text-[#777]">support@example.com</span>
34
- </a>
35
- </div>
36
- </div>
37
- </div>
38
- </div>
39
- </div>
40
- );
41
- };
42
- `
43
- };
44
- }
45
- export {
46
- getContent as default
47
- };
@@ -1,111 +0,0 @@
1
- // pkgs/@akanjs/cli/src/templates/app/ui/MainHeader.tsx
2
- function getContent(scanResult, dict) {
3
- return {
4
- filename: "MainHeader.tsx",
5
- content: `
6
- import { usePage } from "@${dict.appName}/client";
7
- import {
8
- AiOutlineBuild,
9
- AiOutlineEdit,
10
- AiOutlineHome,
11
- AiOutlinePoweroff,
12
- AiOutlinePrinter,
13
- AiOutlineRobot,
14
- AiOutlineSecurityScan,
15
- AiOutlineSend,
16
- AiOutlineUser,
17
- AiOutlineWindows,
18
- } from "react-icons/ai";
19
- import { User } from "@shared/client";
20
- import { Layout, Link } from "@akanjs/ui";
21
- import { ReactNode } from "react";
22
- import { clsx } from "@akanjs/client";
23
-
24
- type DirType = "home" | "send" | "print" | "self";
25
-
26
- const iconMap: { [key in DirType]: ReactNode } = {
27
- home: <AiOutlineHome />,
28
- send: <AiOutlineSend />,
29
- print: <AiOutlinePrinter />,
30
- self: <AiOutlineUser />,
31
- };
32
-
33
- interface MainHeaderProps {
34
- className?: string;
35
- children?: any;
36
- items: {
37
- type: DirType;
38
- name: string;
39
- href?: string;
40
- }[];
41
- type?: "view" | "edit" | "new";
42
- }
43
- export const MainHeader = ({ className, children, items, type = "view" }: MainHeaderProps) => {
44
- const { l } = usePage();
45
- return (
46
- <Layout.Header
47
- className={clsx("fixed left-0 px-2 py-2 bg-base-100/50 backdrop-blur-sm flex items-center gap-2", className)}
48
- >
49
- <Layout.Sider>
50
- <div className="text-4xl font-lemonmilk w-full text-center my-8">${dict.AppName}</div>
51
- <ul className="menu p-4 w-full bg-base-200 text-base-content">
52
- {/* <li>
53
- <User.Zone.Profile/>
54
- </li> */}
55
- <li>
56
- <Link href="/location" className="flex gap-2 items-center text-lg">
57
- {iconMap.home} Home
58
- </Link>
59
- </li>
60
- <li>
61
- <Link href="/self" className="flex gap-2 items-center text-lg">
62
- {iconMap.self} My Profile
63
- </Link>
64
- </li>
65
- <li>
66
- <User.Util.Signout href="/" className="flex gap-2 items-center text-lg text-warning">
67
- <AiOutlinePoweroff /> Sign out
68
- </User.Util.Signout>
69
- </li>
70
- </ul>
71
- </Layout.Sider>
72
- <div className="text-sm breadcrumbs hidden md:block">
73
- <ul>
74
- {items.slice(0, -2).map(({ type, name, href }, idx) => (
75
- <li key={idx}>
76
- <Link className="flex gap-1 items-center" href={href}>
77
- {iconMap[type]} {name}
78
- </Link>
79
- </li>
80
- ))}
81
- <li></li>
82
- </ul>
83
- </div>
84
- <div className="text-sm breadcrumbs -ml-2">
85
- <ul>
86
- {items.slice(-2).map(({ type, name, href }, idx) => (
87
- <li key={idx}>
88
- <Link className="flex gap-1 items-center" href={href}>
89
- {iconMap[type]} {name}
90
- </Link>
91
- </li>
92
- ))}
93
- {type === "new" ? (
94
- <li>+ {l("shared.new")}</li>
95
- ) : type === "edit" ? (
96
- <li className="flex gap-1 items-center">
97
- <AiOutlineEdit /> {l("shared.edit")}
98
- </li>
99
- ) : null}
100
- </ul>
101
- </div>
102
- {children}
103
- </Layout.Header>
104
- );
105
- };
106
- `
107
- };
108
- }
109
- export {
110
- getContent as default
111
- };
@@ -1,9 +0,0 @@
1
- import type { AppScanResult, LibScanResult } from "@akanjs/config";
2
- interface Dict {
3
- [key: string]: string;
4
- }
5
- export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict?: Dict): {
6
- filename: string;
7
- content: string;
8
- };
9
- export {};
@@ -1,9 +0,0 @@
1
- import type { AppScanResult, LibScanResult } from "@akanjs/config";
2
- interface Dict {
3
- CompanyName: string;
4
- }
5
- export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
6
- filename: string;
7
- content: string;
8
- };
9
- export {};
@@ -1,9 +0,0 @@
1
- import type { AppScanResult, LibScanResult } from "@akanjs/config";
2
- interface Dict {
3
- appName: string;
4
- }
5
- export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
6
- filename: string;
7
- content: string;
8
- };
9
- export {};
@@ -1,10 +0,0 @@
1
- import type { AppScanResult, LibScanResult } from "@akanjs/config";
2
- interface Dict {
3
- CompanyName: string;
4
- AppName: string;
5
- }
6
- export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
7
- filename: string;
8
- content: string;
9
- };
10
- export {};
@@ -1,9 +0,0 @@
1
- import type { AppScanResult, LibScanResult } from "@akanjs/config";
2
- interface Dict {
3
- appName: string;
4
- }
5
- export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
6
- filename: string;
7
- content: string;
8
- };
9
- export {};
@@ -1,9 +0,0 @@
1
- import type { AppScanResult, LibScanResult } from "@akanjs/config";
2
- interface Dict {
3
- CompanyName: string;
4
- }
5
- export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
6
- filename: string;
7
- content: string;
8
- };
9
- export {};
@@ -1,10 +0,0 @@
1
- import type { AppScanResult, LibScanResult } from "@akanjs/config";
2
- interface Dict {
3
- appName: string;
4
- AppName: string;
5
- }
6
- export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
7
- filename: string;
8
- content: string;
9
- };
10
- export {};