@zeppos/zeus-cli 1.6.7-beta4 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/modules/build.js +9 -3
  2. package/modules/create.js +3 -0
  3. package/package.json +6 -6
  4. package/private-modules/zeppos-app-utils/dist/logger/index.js +4 -4
  5. package/private-modules/zeppos-app-utils/dist/modules/create/index.js +4 -3
  6. package/private-modules/zeppos-app-utils/dist/modules/fetchDevices.js +3 -3
  7. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/_package.json +17 -0
  8. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/app.js +27 -0
  9. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/app.json +52 -0
  10. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/consume.png +0 -0
  11. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/beer.png +0 -0
  12. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/cake.png +0 -0
  13. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/chocolate.png +0 -0
  14. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/coffee.png +0 -0
  15. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/cookies.png +0 -0
  16. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/ham.png +0 -0
  17. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/hamburger.png +0 -0
  18. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/ice cream.png +0 -0
  19. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/pizza.png +0 -0
  20. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/sausage.png +0 -0
  21. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/icon.png +0 -0
  22. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/multiply.png +0 -0
  23. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/selected.png +0 -0
  24. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/unselected.png +0 -0
  25. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/consume.png +0 -0
  26. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/beer.png +0 -0
  27. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/cake.png +0 -0
  28. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/chocolate.png +0 -0
  29. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/coffee.png +0 -0
  30. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/cookies.png +0 -0
  31. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/ham.png +0 -0
  32. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/hamburger.png +0 -0
  33. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/ice cream.png +0 -0
  34. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/pizza.png +0 -0
  35. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/sausage.png +0 -0
  36. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/icon.png +0 -0
  37. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/multiply.png +0 -0
  38. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/selected.png +0 -0
  39. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/unselected.png +0 -0
  40. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/global.d.ts +1 -0
  41. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/jsconfig.json +9 -0
  42. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/food-list.js +107 -0
  43. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/food-list.r.layout.js +48 -0
  44. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/food-list.s.layout.js +33 -0
  45. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/index.js +127 -0
  46. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/index.r.layout.js +110 -0
  47. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/index.s.layout.js +98 -0
  48. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/i18n/en-US.po +42 -0
  49. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/i18n/zh-CN.po +42 -0
  50. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/utils/constants.js +62 -0
  51. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/utils/storage.js +40 -0
  52. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/_package.json +14 -0
  53. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/app-side/i18n/en-US.po +2 -0
  54. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/app-side/index.js +13 -0
  55. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/app.js +10 -0
  56. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/app.json +60 -0
  57. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/assets/default.b/icon.png +0 -0
  58. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/assets/default.r/icon.png +0 -0
  59. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/assets/default.s/icon.png +0 -0
  60. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/global.d.ts +1 -0
  61. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/jsconfig.json +9 -0
  62. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/page/i18n/en-US.po +2 -0
  63. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/page/index.b.layout.js +6 -0
  64. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/page/index.js +7 -0
  65. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/page/index.r.layout.js +6 -0
  66. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/page/index.s.layout.js +6 -0
  67. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/setting/i18n/en-US.po +2 -0
  68. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/setting/index.js +7 -0
  69. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/_package.json +17 -0
  70. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/app-side/i18n/en-US.po +2 -0
  71. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/app-side/index.js +56 -0
  72. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/app.js +14 -0
  73. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/app.json +51 -0
  74. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/assets/common.r/icon.png +0 -0
  75. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/assets/common.s/icon.png +0 -0
  76. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/global.d.ts +1 -0
  77. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/jsconfig.json +9 -0
  78. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/page/i18n/en-US.po +2 -0
  79. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/page/index.js +45 -0
  80. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/page/index.r.layout.js +32 -0
  81. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/page/index.s.layout.js +32 -0
  82. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/utils/config/constants.js +2 -0
  83. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/utils/config/device.js +2 -0
  84. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/_package.json +17 -0
  85. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/app.js +10 -0
  86. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/app.json +51 -0
  87. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/assets/gt.r/icon.png +0 -0
  88. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/assets/gt.r/image/logo.png +0 -0
  89. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/assets/gt.s/icon.png +0 -0
  90. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/assets/gt.s/image/logo.png +0 -0
  91. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/global.d.ts +1 -0
  92. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/jsconfig.json +9 -0
  93. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/page/gt/home/index.page.js +17 -0
  94. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/page/gt/home/index.page.r.layout.js +19 -0
  95. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/page/gt/home/index.page.s.layout.js +19 -0
  96. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/page/i18n/en-US.po +2 -0
  97. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/page/i18n/zh-CN.po +2 -0
  98. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/utils/index.js +3 -0
  99. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/_package.json +17 -0
  100. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/app.js +16 -0
  101. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/app.json +71 -0
  102. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/assets/default.b/icon.png +0 -0
  103. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/assets/default.r/icon.png +0 -0
  104. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/assets/default.r/images/icons/ic_moon.png +0 -0
  105. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/assets/default.s/icon.png +0 -0
  106. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/global.d.ts +1 -0
  107. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/jsconfig.json +9 -0
  108. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_01/index.js +205 -0
  109. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_01/index.r.layout.js +106 -0
  110. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_02/index.js +88 -0
  111. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_02/index.r.layout.js +74 -0
  112. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_03/index.js +98 -0
  113. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_03/index.r.layout.js +80 -0
  114. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/i18n/en-US.po +2 -0
  115. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/index.js +53 -0
  116. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/index.r.layout.js +75 -0
  117. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/.prettierrc.js +6 -0
  118. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/_package.json +17 -0
  119. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/app-side/index.js +47 -0
  120. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/app.js +17 -0
  121. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/app.json +55 -0
  122. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.r/add.png +0 -0
  123. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.r/delete.png +0 -0
  124. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.r/icon.png +0 -0
  125. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.s/add.png +0 -0
  126. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.s/delete.png +0 -0
  127. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.s/icon.png +0 -0
  128. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/global.d.ts +1 -0
  129. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/jsconfig.json +9 -0
  130. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/page/home/index.page.js +177 -0
  131. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/page/home/index.page.r.layout.js +112 -0
  132. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/page/home/index.page.s.layout.js +112 -0
  133. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/page/i18n/en-US.po +21 -0
  134. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/setting/i18n/en-US.po +5 -0
  135. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/setting/index.js +143 -0
  136. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/utils/constants.js +3 -0
  137. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/utils/fs.js +34 -0
  138. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/utils/index.js +38 -0
  139. package/private-modules/zeppos-app-utils/package.json +4 -4
@@ -0,0 +1,112 @@
1
+ import * as hmUI from '@zos/ui'
2
+ import { getText } from '@zos/i18n'
3
+ import { getDeviceInfo } from '@zos/device'
4
+ import { px } from '@zos/utils'
5
+
6
+ export const { width: DEVICE_WIDTH, height: DEVICE_HEIGHT } = getDeviceInfo()
7
+
8
+ export const TITLE_TEXT_STYLE = {
9
+ text: getText('todoList'),
10
+ x: px(42),
11
+ y: px(65),
12
+ w: DEVICE_WIDTH - px(42 * 2),
13
+ h: px(50),
14
+ color: 0xffffff,
15
+ text_size: 36,
16
+ align_h: hmUI.align.CENTER_H,
17
+ text_style: hmUI.text_style.WRAP
18
+ }
19
+
20
+ export const ADD_BUTTON = {
21
+ x: Math.floor((DEVICE_WIDTH - px(88)) / 2),
22
+ y: DEVICE_HEIGHT - px(100),
23
+ w: px(88),
24
+ h: px(88),
25
+ normal_src: 'add.png',
26
+ press_src: 'add.png'
27
+ }
28
+
29
+ export const TIPS_TEXT_STYLE = {
30
+ text: getText('noData'),
31
+ x: px(15),
32
+ y: px(120),
33
+ w: DEVICE_WIDTH - px(15 * 2),
34
+ h: DEVICE_HEIGHT - px(120),
35
+ color: 0xffffff,
36
+ text_size: px(32),
37
+ align_h: hmUI.align.CENTER_H,
38
+ align_v: hmUI.align.CENTER_V,
39
+ text_style: hmUI.text_style.WRAP
40
+ }
41
+
42
+ export const SCROLL_LIST = {
43
+ item_height: px(120),
44
+ item_space: px(10),
45
+ item_config: [
46
+ {
47
+ type_id: 1,
48
+ item_bg_color: 0x333333,
49
+ item_bg_radius: px(25),
50
+ text_view: [
51
+ {
52
+ x: px(80),
53
+ y: px(0),
54
+ w: px(360),
55
+ h: px(120),
56
+ key: 'name',
57
+ color: 0xffff00,
58
+ text_size: px(36),
59
+ align_h: hmUI.align.LEFT
60
+ }
61
+ ],
62
+ text_view_count: 1,
63
+ image_view: [
64
+ {
65
+ x: DEVICE_WIDTH - px(10),
66
+ y: px(16),
67
+ w: px(88),
68
+ h: px(88),
69
+ key: 'img_src',
70
+ action: true
71
+ }
72
+ ],
73
+ image_view_count: 1,
74
+ item_height: px(120)
75
+ },
76
+ {
77
+ type_id: 2,
78
+ item_bg_color: 0x333333,
79
+ item_bg_radius: px(25),
80
+ text_view: [
81
+ {
82
+ x: px(80),
83
+ y: px(0),
84
+ w: px(360),
85
+ h: px(120),
86
+ key: 'name',
87
+ color: 0xff0000,
88
+ text_size: px(36),
89
+ align_h: hmUI.align.LEFT
90
+ }
91
+ ],
92
+ text_view_count: 1,
93
+ image_view: [
94
+ {
95
+ x: DEVICE_WIDTH - px(10),
96
+ y: px(16),
97
+ w: px(88),
98
+ h: px(88),
99
+ key: 'img_src',
100
+ action: true
101
+ }
102
+ ],
103
+ image_view_count: 1,
104
+ item_height: px(120)
105
+ }
106
+ ],
107
+ item_config_count: 2,
108
+ x: px(10),
109
+ y: px(80),
110
+ h: px(250),
111
+ w: DEVICE_WIDTH - px(10) * 2
112
+ }
@@ -0,0 +1,21 @@
1
+
2
+ msgid "todoList"
3
+ msgstr "todo List"
4
+
5
+ msgid "noData"
6
+ msgstr "No data, please add it on the phone"
7
+
8
+ msgid "add"
9
+ msgstr "Add"
10
+
11
+ msgid "deleteSuccess"
12
+ msgstr "successfully deleted"
13
+
14
+ msgid "deleteFailure"
15
+ msgstr "Delete failed, check the network"
16
+
17
+ msgid "addSuccess"
18
+ msgstr "Added successfully"
19
+
20
+ msgid "addFailure"
21
+ msgstr "Failed to add, check the network"
@@ -0,0 +1,5 @@
1
+ msgid "addTodo"
2
+ msgstr "ADD TODO"
3
+
4
+ msgid "delete"
5
+ msgstr "DELETE"
@@ -0,0 +1,143 @@
1
+ import { gettext } from 'i18n'
2
+ import { DEFAULT_TODO_LIST } from './../utils/constants'
3
+ AppSettingsPage({
4
+ state: {
5
+ todoList: [],
6
+ props: {}
7
+ },
8
+ addTodoList(val) {
9
+ this.state.todoList = [...this.state.todoList, val]
10
+ this.setItem()
11
+ },
12
+ editTodoList(val, index) {
13
+ this.state.todoList[index] = val
14
+ this.setItem()
15
+ },
16
+ deleteTodoList(index) {
17
+ this.state.todoList = this.state.todoList.filter((_, ind) => {
18
+ return ind !== index
19
+ })
20
+ this.setItem()
21
+ },
22
+ setItem() {
23
+ const newString = JSON.stringify(this.state.todoList)
24
+ this.state.props.settingsStorage.setItem('todoList', newString)
25
+ },
26
+ setState(props) {
27
+ this.state.props = props
28
+ if (props.settingsStorage.getItem('todoList')) {
29
+ this.state.todoList = JSON.parse(props.settingsStorage.getItem('todoList'))
30
+ } else {
31
+ this.state.todoList = [...DEFAULT_TODO_LIST]
32
+ }
33
+ console.log('todoList: ', this.state.todoList)
34
+ },
35
+ build(props) {
36
+ this.setState(props)
37
+ const contentItems = []
38
+ const addBTN = View(
39
+ {
40
+ style: {
41
+ fontSize: '12px',
42
+ lineHeight: '30px',
43
+ borderRadius: '30px',
44
+ background: '#409EFF',
45
+ color: 'white',
46
+ textAlign: 'center',
47
+ padding: '0 15px',
48
+ width: '30%'
49
+ }
50
+ },
51
+ [
52
+ TextInput({
53
+ label: gettext('addTodo'),
54
+ onChange: (val) => {
55
+ this.addTodoList(val)
56
+ }
57
+ })
58
+ ]
59
+ )
60
+ this.state.todoList.forEach((item, index) => {
61
+ contentItems.push(
62
+ View(
63
+ {
64
+ style: {
65
+ borderBottom: '1px solid #eaeaea',
66
+ padding: '6px 0',
67
+ marginBottom: '6px',
68
+ display: 'flex',
69
+ flexDirection: 'row'
70
+ }
71
+ },
72
+ [
73
+ View(
74
+ {
75
+ style: {
76
+ flex: 1,
77
+ display: 'flex',
78
+ flexDirection: 'row',
79
+ justfyContent: 'center',
80
+ alignItems: 'center'
81
+ }
82
+ },
83
+ [
84
+ TextInput({
85
+ label: '',
86
+ bold: true,
87
+ value: item,
88
+ subStyle: {
89
+ color: '#333',
90
+ fontSize: '14px'
91
+ },
92
+ maxLength: 200,
93
+ onChange: (val) => {
94
+ if (val.length > 0 && val.length <= 200) {
95
+ this.editTodoList(val, index)
96
+ } else {
97
+ console.log("todoList can't be empty or too long!")
98
+ }
99
+ }
100
+ })
101
+ ]
102
+ ),
103
+ Button({
104
+ label: gettext('delete'),
105
+ style: {
106
+ fontSize: '12px',
107
+ borderRadius: '30px',
108
+ background: '#D85E33',
109
+ color: 'white'
110
+ },
111
+ onClick: () => {
112
+ this.deleteTodoList(index)
113
+ }
114
+ })
115
+ ]
116
+ )
117
+ )
118
+ })
119
+ return View(
120
+ {
121
+ style: {
122
+ padding: '12px 20px'
123
+ }
124
+ },
125
+ [
126
+ addBTN,
127
+ contentItems.length > 0 &&
128
+ View(
129
+ {
130
+ style: {
131
+ marginTop: '12px',
132
+ padding: '10px',
133
+ border: '1px solid #eaeaea',
134
+ borderRadius: '6px',
135
+ backgroundColor: 'white'
136
+ }
137
+ },
138
+ [...contentItems]
139
+ )
140
+ ]
141
+ )
142
+ }
143
+ })
@@ -0,0 +1,3 @@
1
+ export const DEFAULT_TODO_LIST = ['Learn'] // 'Drink', 'Food'
2
+
3
+ export const TODO_FILE_NAME = 'fs_todo_list.txt'
@@ -0,0 +1,34 @@
1
+ import { statSync, writeFileSync as writeFile, readFileSync as readFile } from '@zos/fs'
2
+
3
+ import { TODO_FILE_NAME } from './constants'
4
+
5
+ export function readFileSync() {
6
+ const fStat = statSync({
7
+ path: this.fileName
8
+ })
9
+ if (fStat) {
10
+ const resData = readFile({
11
+ path: TODO_FILE_NAME,
12
+ options: {
13
+ encoding: 'utf8'
14
+ }
15
+ })
16
+ return !resData ? [] : JSON.parse(resData)
17
+ } else {
18
+ return []
19
+ }
20
+ }
21
+
22
+ export function writeFileSync(data, merge = true) {
23
+ let params = data
24
+ if (merge) {
25
+ params = [...readFile(), ...data]
26
+ }
27
+ writeFile({
28
+ path: TODO_FILE_NAME,
29
+ data: JSON.stringify(params),
30
+ options: {
31
+ encoding: 'utf8'
32
+ }
33
+ })
34
+ }
@@ -0,0 +1,38 @@
1
+ export function getScrollListDataConfig(activeIndex, length) {
2
+ const dataTypeConfig = []
3
+ if (activeIndex === -1) {
4
+ dataTypeConfig.push({
5
+ start: 0,
6
+ end: length,
7
+ type_id: 2
8
+ })
9
+ } else if (activeIndex === 0) {
10
+ dataTypeConfig.push({
11
+ start: 0,
12
+ end: activeIndex,
13
+ type_id: 1
14
+ })
15
+ dataTypeConfig.push({
16
+ start: activeIndex + 1,
17
+ end: length,
18
+ type_id: 2
19
+ })
20
+ } else {
21
+ dataTypeConfig.push({
22
+ start: 0,
23
+ end: activeIndex - 1,
24
+ type_id: 2
25
+ })
26
+ dataTypeConfig.push({
27
+ start: activeIndex,
28
+ end: activeIndex,
29
+ type_id: 1
30
+ })
31
+ dataTypeConfig.push({
32
+ start: activeIndex + 1,
33
+ end: length,
34
+ type_id: 2
35
+ })
36
+ }
37
+ return dataTypeConfig
38
+ }
@@ -13,8 +13,8 @@
13
13
  "dev": "nodemon -e ts,tsx --exec \"rimraf dist && tsc && ts-node build.ts\" --ignore types/ --ignore dist/"
14
14
  },
15
15
  "dependencies": {
16
- "@zeppos/zpm": "^3.1.13-beta2",
17
- "axios": "^1.7.7",
16
+ "@zeppos/zpm": "^3.2.0",
17
+ "axios": "1.8.2",
18
18
  "chalk": "^4.1.2",
19
19
  "chokidar": "^3.6.0",
20
20
  "define-lazy-prop": "^2.0.0",
@@ -24,7 +24,7 @@
24
24
  "fs-extra": "^10.1.0",
25
25
  "get-port": "5.1.1",
26
26
  "inquirer": "^8.2.6",
27
- "is-docker": "^2.1.1",
27
+ "is-docker": "^2.2.1",
28
28
  "is-wsl": "^2.2.0",
29
29
  "lodash": "^4.17.21",
30
30
  "parse-gitignore": "^2.0.0",
@@ -52,6 +52,6 @@
52
52
  "@types/update-notifier": "5.0.0",
53
53
  "@types/yargs-parser": "^21.0.3",
54
54
  "@types/yeoman-environment": "^2.10.11",
55
- "rimraf": "^3.0.2"
55
+ "rimraf": "^6.0.1"
56
56
  }
57
57
  }