create-basicjs 0.1.0 → 0.1.2

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 (727) hide show
  1. package/README.md +1 -1
  2. package/bin/create-basicjs.js +2 -2
  3. package/bin/verify-package.js +16 -0
  4. package/package.json +4 -1
  5. package/payload/starter/AGENTS.md +84 -0
  6. package/payload/starter/CLAUDE.md +1 -0
  7. package/payload/starter/README.md +45 -0
  8. package/payload/starter/_basic/VERSION +1 -0
  9. package/payload/starter/_basic/assets/categories/cappuccino.png +0 -0
  10. package/payload/starter/_basic/assets/categories/chocolate-milk.png +0 -0
  11. package/payload/starter/_basic/assets/categories/coffee-cup.png +0 -0
  12. package/payload/starter/_basic/assets/categories/coffee.png +0 -0
  13. package/payload/starter/_basic/assets/categories/frappe.png +0 -0
  14. package/payload/starter/_basic/assets/categories/iced-caffee.png +0 -0
  15. package/payload/starter/_basic/assets/categories/milkshake.png +0 -0
  16. package/payload/starter/_basic/assets/categories/orange-juice.png +0 -0
  17. package/payload/starter/_basic/assets/categories/tea.png +0 -0
  18. package/payload/starter/_basic/assets/data-table/palette.svg +2 -0
  19. package/payload/starter/_basic/assets/data-table/people.js +104 -0
  20. package/payload/starter/_basic/assets/data-table/trash.svg +2 -0
  21. package/payload/starter/_basic/assets/fruids/brokoli.png +0 -0
  22. package/payload/starter/_basic/assets/fruids/cilek.png +0 -0
  23. package/payload/starter/_basic/assets/fruids/domates.png +0 -0
  24. package/payload/starter/_basic/assets/fruids/elma.png +0 -0
  25. package/payload/starter/_basic/assets/fruids/havuc.png +0 -0
  26. package/payload/starter/_basic/assets/fruids/karpuz.png +0 -0
  27. package/payload/starter/_basic/assets/fruids/limon.png +0 -0
  28. package/payload/starter/_basic/assets/fruids/muz.png +0 -0
  29. package/payload/starter/_basic/assets/fruids/nar.png +0 -0
  30. package/payload/starter/_basic/assets/fruids/patlican.png +0 -0
  31. package/payload/starter/_basic/assets/fruids/yabanmersini.png +0 -0
  32. package/payload/starter/_basic/assets/fruids/yesilbiber.png +0 -0
  33. package/payload/starter/_basic/assets/icons/alert-black.png +0 -0
  34. package/payload/starter/_basic/assets/icons/alert.png +0 -0
  35. package/payload/starter/_basic/assets/icons/arrow-drop.svg +3 -0
  36. package/payload/starter/_basic/assets/icons/arrow-rise.svg +3 -0
  37. package/payload/starter/_basic/assets/icons/close.svg +1 -0
  38. package/payload/starter/_basic/assets/icons/lamp-on.png +0 -0
  39. package/payload/starter/_basic/assets/icons/lamp.png +0 -0
  40. package/payload/starter/_basic/assets/icons/lock.png +0 -0
  41. package/payload/starter/_basic/assets/icons/panel.png +0 -0
  42. package/payload/starter/_basic/assets/icons/plant.png +0 -0
  43. package/payload/starter/_basic/assets/icons/trash.png +0 -0
  44. package/payload/starter/_basic/assets/icons/trash.svg +2 -0
  45. package/payload/starter/_basic/assets/tab-bar/settings.png +0 -0
  46. package/payload/starter/_basic/assets/tab-bar/status.png +0 -0
  47. package/payload/starter/_basic/assets/tab-bar/transactions.png +0 -0
  48. package/payload/starter/_basic/assets/tutorial/blueberries.png +0 -0
  49. package/payload/starter/_basic/assets/tutorial/carrot.png +0 -0
  50. package/payload/starter/_basic/assets/tutorial/olives.png +0 -0
  51. package/payload/starter/_basic/assets/tutorial/strawberry.png +0 -0
  52. package/payload/starter/_basic/assets/ui-bottom-bar/setting.svg +11 -0
  53. package/payload/starter/_basic/basic/LICENSE +14 -0
  54. package/payload/starter/_basic/basic/basic.css +277 -0
  55. package/payload/starter/_basic/basic/basic.js +3767 -0
  56. package/payload/starter/_basic/basic/basic.min.css +1 -0
  57. package/payload/starter/_basic/basic/basic.min.js +65 -0
  58. package/payload/starter/_basic/basic/font/open-sans/LICENSE.txt +206 -0
  59. package/payload/starter/_basic/basic/font/open-sans/OpenSans-Bold.ttf +0 -0
  60. package/payload/starter/_basic/basic/font/open-sans/OpenSans-Regular.ttf +0 -0
  61. package/payload/starter/_basic/basic/scroll-bar.js +536 -0
  62. package/payload/starter/_basic/basic/scroll-bar.min.js +2 -0
  63. package/payload/starter/_basic/comp/action-button/add.png +0 -0
  64. package/payload/starter/_basic/comp/action-button.js +522 -0
  65. package/payload/starter/_basic/comp/action-tab-bar.js +383 -0
  66. package/payload/starter/_basic/comp/app-bar.js +236 -0
  67. package/payload/starter/_basic/comp/badge-v2.js +246 -0
  68. package/payload/starter/_basic/comp/bottom-bar.js +547 -0
  69. package/payload/starter/_basic/comp/breadcrumbs.js +522 -0
  70. package/payload/starter/_basic/comp/chart-box/chart-4.5.1.umd.min.js +13 -0
  71. package/payload/starter/_basic/comp/chart-box/chart-js-LICENSE.md +9 -0
  72. package/payload/starter/_basic/comp/chart-box.js +868 -0
  73. package/payload/starter/_basic/comp/check-box.js +374 -0
  74. package/payload/starter/_basic/comp/context-menu.js +634 -0
  75. package/payload/starter/_basic/comp/currency-input-b.js +190 -0
  76. package/payload/starter/_basic/comp/data-table/arrow.svg +2 -0
  77. package/payload/starter/_basic/comp/data-table.js +865 -0
  78. package/payload/starter/_basic/comp/dialog.js +854 -0
  79. package/payload/starter/_basic/comp/email-input-b.js +57 -0
  80. package/payload/starter/_basic/comp/filters.js +493 -0
  81. package/payload/starter/_basic/comp/form.js +590 -0
  82. package/payload/starter/_basic/comp/full-screen-select/arrow.svg +2 -0
  83. package/payload/starter/_basic/comp/full-screen-select/cancel.svg +2 -0
  84. package/payload/starter/_basic/comp/full-screen-select.js +611 -0
  85. package/payload/starter/_basic/comp/gauge.js +435 -0
  86. package/payload/starter/_basic/comp/hold-to-confirm-button/trash-red.png +0 -0
  87. package/payload/starter/_basic/comp/hold-to-confirm-button/trash.png +0 -0
  88. package/payload/starter/_basic/comp/hold-to-confirm-button.js +280 -0
  89. package/payload/starter/_basic/comp/input-b.js +759 -0
  90. package/payload/starter/_basic/comp/item-list.js +1396 -0
  91. package/payload/starter/_basic/comp/label-editor.js +1137 -0
  92. package/payload/starter/_basic/comp/left-menu/_Material Symbols & Icons - Google Fonts.webloc +8 -0
  93. package/payload/starter/_basic/comp/left-menu/data-table.png +0 -0
  94. package/payload/starter/_basic/comp/left-menu/home.png +0 -0
  95. package/payload/starter/_basic/comp/left-menu/reports.png +0 -0
  96. package/payload/starter/_basic/comp/left-menu/setting.png +0 -0
  97. package/payload/starter/_basic/comp/left-menu.js +476 -0
  98. package/payload/starter/_basic/comp/line-progress-bar.js +192 -0
  99. package/payload/starter/_basic/comp/loading-screen.js +382 -0
  100. package/payload/starter/_basic/comp/login-page-v2.js +586 -0
  101. package/payload/starter/_basic/comp/mini-graph-box.js +483 -0
  102. package/payload/starter/_basic/comp/notice.js +227 -0
  103. package/payload/starter/_basic/comp/number-input-b.js +121 -0
  104. package/payload/starter/_basic/comp/numeric-keyboard.js +296 -0
  105. package/payload/starter/_basic/comp/page-control.js +745 -0
  106. package/payload/starter/_basic/comp/page-header.js +190 -0
  107. package/payload/starter/_basic/comp/password-input-b/hide-btn.png +0 -0
  108. package/payload/starter/_basic/comp/password-input-b/hide-btn2.png +0 -0
  109. package/payload/starter/_basic/comp/password-input-b/show-btn.png +0 -0
  110. package/payload/starter/_basic/comp/password-input-b/show-btn2.png +0 -0
  111. package/payload/starter/_basic/comp/password-input-b.js +164 -0
  112. package/payload/starter/_basic/comp/period-bar.js +435 -0
  113. package/payload/starter/_basic/comp/phone-input-b.js +287 -0
  114. package/payload/starter/_basic/comp/progress-bar.js +676 -0
  115. package/payload/starter/_basic/comp/property-panel.js +2740 -0
  116. package/payload/starter/_basic/comp/radio-button.js +467 -0
  117. package/payload/starter/_basic/comp/rich-text-editor.js +1061 -0
  118. package/payload/starter/_basic/comp/scrolling-text.js +296 -0
  119. package/payload/starter/_basic/comp/search-input-v2/clear-round.svg +1 -0
  120. package/payload/starter/_basic/comp/search-input-v2/clear.svg +1 -0
  121. package/payload/starter/_basic/comp/search-input-v2/filter.png +0 -0
  122. package/payload/starter/_basic/comp/search-input-v2/filter.svg +1 -0
  123. package/payload/starter/_basic/comp/search-input-v2/search.svg +1 -0
  124. package/payload/starter/_basic/comp/search-input-v2.js +427 -0
  125. package/payload/starter/_basic/comp/search-results.js +560 -0
  126. package/payload/starter/_basic/comp/select-box.js +1740 -0
  127. package/payload/starter/_basic/comp/select-color.js +603 -0
  128. package/payload/starter/_basic/comp/select-date.js +1003 -0
  129. package/payload/starter/_basic/comp/select-file.js +732 -0
  130. package/payload/starter/_basic/comp/select-time.js +979 -0
  131. package/payload/starter/_basic/comp/settings-row.js +298 -0
  132. package/payload/starter/_basic/comp/side-panel.js +573 -0
  133. package/payload/starter/_basic/comp/slider-field.js +776 -0
  134. package/payload/starter/_basic/comp/slider.js +368 -0
  135. package/payload/starter/_basic/comp/smart-button/alert-black.png +0 -0
  136. package/payload/starter/_basic/comp/smart-button/clock.png +0 -0
  137. package/payload/starter/_basic/comp/smart-button.js +896 -0
  138. package/payload/starter/_basic/comp/smart-table/clock.png +0 -0
  139. package/payload/starter/_basic/comp/smart-table/down.png +0 -0
  140. package/payload/starter/_basic/comp/smart-table/scroll.png +0 -0
  141. package/payload/starter/_basic/comp/smart-table/sort.png +0 -0
  142. package/payload/starter/_basic/comp/smart-table/up.png +0 -0
  143. package/payload/starter/_basic/comp/smart-table.js +1321 -0
  144. package/payload/starter/_basic/comp/sortable-list.js +1172 -0
  145. package/payload/starter/_basic/comp/spark-line-box.js +729 -0
  146. package/payload/starter/_basic/comp/stepper.js +699 -0
  147. package/payload/starter/_basic/comp/tabs.js +1317 -0
  148. package/payload/starter/_basic/comp/tag-input.js +1067 -0
  149. package/payload/starter/_basic/comp/tap-effect.js +168 -0
  150. package/payload/starter/_basic/comp/textarea-b.js +184 -0
  151. package/payload/starter/_basic/comp/time-line.js +324 -0
  152. package/payload/starter/_basic/comp/tiny-select/arrow.svg +1 -0
  153. package/payload/starter/_basic/comp/tiny-select.js +282 -0
  154. package/payload/starter/_basic/comp/tiny-table.js +279 -0
  155. package/payload/starter/_basic/comp/toast.js +838 -0
  156. package/payload/starter/_basic/comp/toggle.js +636 -0
  157. package/payload/starter/_basic/comp/tooltip.js +471 -0
  158. package/payload/starter/_basic/comp/tree-view.js +1096 -0
  159. package/payload/starter/_basic/comp/ui-effects.js +1091 -0
  160. package/payload/starter/_basic/comp/ui-standards.js +402 -0
  161. package/payload/starter/_basic/comp/url-input-b.js +145 -0
  162. package/payload/starter/_basic/comp/web-view.js +534 -0
  163. package/payload/starter/_basic/docs/basic-js-animated-rules.md +90 -0
  164. package/payload/starter/_basic/docs/basic-js-code-rules.md +91 -0
  165. package/payload/starter/_basic/docs/basic-js-components.md +134 -0
  166. package/payload/starter/_basic/docs/basic-js-core.md +131 -0
  167. package/payload/starter/_basic/docs/component-index.md +522 -0
  168. package/payload/starter/_basic/docs/component-template.js +416 -0
  169. package/payload/starter/_basic/docs/handbook/00-introduction.md +125 -0
  170. package/payload/starter/_basic/docs/handbook/00-what-is-new.md +96 -0
  171. package/payload/starter/_basic/docs/handbook/01-label.md +104 -0
  172. package/payload/starter/_basic/docs/handbook/02-box.md +166 -0
  173. package/payload/starter/_basic/docs/handbook/03-image.md +81 -0
  174. package/payload/starter/_basic/docs/handbook/04-common-properties.md +159 -0
  175. package/payload/starter/_basic/docs/handbook/05-autolayout.md +332 -0
  176. package/payload/starter/_basic/docs/handbook/06-button.md +103 -0
  177. package/payload/starter/_basic/docs/handbook/07-input.md +78 -0
  178. package/payload/starter/_basic/docs/handbook/08-page.md +120 -0
  179. package/payload/starter/_basic/docs/handbook/09-useful-examples.md +309 -0
  180. package/payload/starter/_basic/docs/handbook/10-motion.md +132 -0
  181. package/payload/starter/_basic/docs/handbook/11-other-functions.md +92 -0
  182. package/payload/starter/_basic/docs/handbook/12-utilities.md +123 -0
  183. package/payload/starter/_basic/docs/handbook/13-sound.md +88 -0
  184. package/payload/starter/_basic/docs/what-is-new.md +402 -0
  185. package/payload/starter/_basic/examples/action-button.htm +81 -0
  186. package/payload/starter/_basic/examples/action-tab-bar.htm +97 -0
  187. package/payload/starter/_basic/examples/app-bar.htm +140 -0
  188. package/payload/starter/_basic/examples/badgeV2.htm +68 -0
  189. package/payload/starter/_basic/examples/bottom-bar/grid.png +0 -0
  190. package/payload/starter/_basic/examples/bottom-bar/grids.png +0 -0
  191. package/payload/starter/_basic/examples/bottom-bar/home.png +0 -0
  192. package/payload/starter/_basic/examples/bottom-bar/homes.png +0 -0
  193. package/payload/starter/_basic/examples/bottom-bar/icon1.png +0 -0
  194. package/payload/starter/_basic/examples/bottom-bar/icon1s.png +0 -0
  195. package/payload/starter/_basic/examples/bottom-bar/icon2.png +0 -0
  196. package/payload/starter/_basic/examples/bottom-bar/icon2s.png +0 -0
  197. package/payload/starter/_basic/examples/bottom-bar/icon3.png +0 -0
  198. package/payload/starter/_basic/examples/bottom-bar/icon3s.png +0 -0
  199. package/payload/starter/_basic/examples/bottom-bar/icon4.png +0 -0
  200. package/payload/starter/_basic/examples/bottom-bar/icon4s.png +0 -0
  201. package/payload/starter/_basic/examples/bottom-bar/search.png +0 -0
  202. package/payload/starter/_basic/examples/bottom-bar/searchs.png +0 -0
  203. package/payload/starter/_basic/examples/bottom-bar/settings.png +0 -0
  204. package/payload/starter/_basic/examples/bottom-bar/settingss.png +0 -0
  205. package/payload/starter/_basic/examples/bottom-bar/tasks.png +0 -0
  206. package/payload/starter/_basic/examples/bottom-bar/taskss.png +0 -0
  207. package/payload/starter/_basic/examples/bottom-bar-2.htm +187 -0
  208. package/payload/starter/_basic/examples/bottom-bar.htm +46 -0
  209. package/payload/starter/_basic/examples/breadcrumbs.htm +284 -0
  210. package/payload/starter/_basic/examples/chart-box.htm +287 -0
  211. package/payload/starter/_basic/examples/check-box-1.htm +220 -0
  212. package/payload/starter/_basic/examples/check-box-2.htm +212 -0
  213. package/payload/starter/_basic/examples/check-box-3.htm +179 -0
  214. package/payload/starter/_basic/examples/context-menu.htm +269 -0
  215. package/payload/starter/_basic/examples/currency-input-b.htm +71 -0
  216. package/payload/starter/_basic/examples/data-table-2.htm +67 -0
  217. package/payload/starter/_basic/examples/data-table-3.htm +72 -0
  218. package/payload/starter/_basic/examples/data-table-4.htm +144 -0
  219. package/payload/starter/_basic/examples/data-table-5.htm +152 -0
  220. package/payload/starter/_basic/examples/data-table.htm +178 -0
  221. package/payload/starter/_basic/examples/dialog-centered.htm +130 -0
  222. package/payload/starter/_basic/examples/dialog.htm +209 -0
  223. package/payload/starter/_basic/examples/email-input-b.htm +67 -0
  224. package/payload/starter/_basic/examples/filters.htm +115 -0
  225. package/payload/starter/_basic/examples/form-1.htm +123 -0
  226. package/payload/starter/_basic/examples/full-screen-select.htm +114 -0
  227. package/payload/starter/_basic/examples/gauge.htm +133 -0
  228. package/payload/starter/_basic/examples/hold-to-confirm-button.htm +144 -0
  229. package/payload/starter/_basic/examples/input-b-ex1.htm +132 -0
  230. package/payload/starter/_basic/examples/input-b-ex2.htm +136 -0
  231. package/payload/starter/_basic/examples/input-b-ex3-style.htm +113 -0
  232. package/payload/starter/_basic/examples/input-b-ex4-custom-unit.htm +112 -0
  233. package/payload/starter/_basic/examples/input-b-ex5-warning-icon.htm +80 -0
  234. package/payload/starter/_basic/examples/input-b-ex6-dark.htm +108 -0
  235. package/payload/starter/_basic/examples/input-b-ex7-ozden.htm +153 -0
  236. package/payload/starter/_basic/examples/item-list-2.htm +253 -0
  237. package/payload/starter/_basic/examples/item-list.htm +176 -0
  238. package/payload/starter/_basic/examples/label-editor.htm +196 -0
  239. package/payload/starter/_basic/examples/left-menu.htm +81 -0
  240. package/payload/starter/_basic/examples/line-progress-bar.htm +145 -0
  241. package/payload/starter/_basic/examples/loading-screen.htm +217 -0
  242. package/payload/starter/_basic/examples/login-page-dark-v2.htm +269 -0
  243. package/payload/starter/_basic/examples/login-page-v2.htm +269 -0
  244. package/payload/starter/_basic/examples/mini-graph-box.htm +229 -0
  245. package/payload/starter/_basic/examples/notice.htm +79 -0
  246. package/payload/starter/_basic/examples/number-input-b.htm +68 -0
  247. package/payload/starter/_basic/examples/numeric-keyboard.htm +100 -0
  248. package/payload/starter/_basic/examples/page-control.htm +262 -0
  249. package/payload/starter/_basic/examples/page-header.htm +117 -0
  250. package/payload/starter/_basic/examples/password-input-b.htm +70 -0
  251. package/payload/starter/_basic/examples/period-bar.htm +94 -0
  252. package/payload/starter/_basic/examples/phone-input-b-select-country.htm +298 -0
  253. package/payload/starter/_basic/examples/phone-input-b.htm +72 -0
  254. package/payload/starter/_basic/examples/progress-bar-ozden.htm +168 -0
  255. package/payload/starter/_basic/examples/progress-bar.htm +296 -0
  256. package/payload/starter/_basic/examples/property-panel.htm +216 -0
  257. package/payload/starter/_basic/examples/radio-button-1.htm +264 -0
  258. package/payload/starter/_basic/examples/radio-button-2.htm +256 -0
  259. package/payload/starter/_basic/examples/radio-button-3.htm +168 -0
  260. package/payload/starter/_basic/examples/rich-text-editor.htm +228 -0
  261. package/payload/starter/_basic/examples/scrolling-text.htm +75 -0
  262. package/payload/starter/_basic/examples/search-input-v2-ozden.htm +128 -0
  263. package/payload/starter/_basic/examples/search-input-v2-place.htm +80 -0
  264. package/payload/starter/_basic/examples/search-input-v2.htm +65 -0
  265. package/payload/starter/_basic/examples/search-results.htm +193 -0
  266. package/payload/starter/_basic/examples/select-box-ozden-item.htm +114 -0
  267. package/payload/starter/_basic/examples/select-box-ozden-text.htm +64 -0
  268. package/payload/starter/_basic/examples/select-box.htm +254 -0
  269. package/payload/starter/_basic/examples/select-color.htm +215 -0
  270. package/payload/starter/_basic/examples/select-date.htm +244 -0
  271. package/payload/starter/_basic/examples/select-file.htm +268 -0
  272. package/payload/starter/_basic/examples/select-time.htm +249 -0
  273. package/payload/starter/_basic/examples/settings-row.htm +193 -0
  274. package/payload/starter/_basic/examples/side-panel-2.htm +270 -0
  275. package/payload/starter/_basic/examples/side-panel.htm +219 -0
  276. package/payload/starter/_basic/examples/slider-field.htm +223 -0
  277. package/payload/starter/_basic/examples/slider.htm +180 -0
  278. package/payload/starter/_basic/examples/smart-button-2.htm +220 -0
  279. package/payload/starter/_basic/examples/smart-button-3-ozden.htm +320 -0
  280. package/payload/starter/_basic/examples/smart-button-4-dark.htm +102 -0
  281. package/payload/starter/_basic/examples/smart-button-5-features.htm +205 -0
  282. package/payload/starter/_basic/examples/smart-button.htm +252 -0
  283. package/payload/starter/_basic/examples/smart-table-1.htm +142 -0
  284. package/payload/starter/_basic/examples/smart-table-2.htm +191 -0
  285. package/payload/starter/_basic/examples/smart-table-3.htm +359 -0
  286. package/payload/starter/_basic/examples/smart-table-4.htm +158 -0
  287. package/payload/starter/_basic/examples/sortable-list.htm +250 -0
  288. package/payload/starter/_basic/examples/spark-line-box.htm +285 -0
  289. package/payload/starter/_basic/examples/stepper-2.htm +172 -0
  290. package/payload/starter/_basic/examples/stepper.htm +255 -0
  291. package/payload/starter/_basic/examples/tabs-2/coffee.png +0 -0
  292. package/payload/starter/_basic/examples/tabs-2/i1-white.png +0 -0
  293. package/payload/starter/_basic/examples/tabs-2/i1.png +0 -0
  294. package/payload/starter/_basic/examples/tabs-2/i2-white.png +0 -0
  295. package/payload/starter/_basic/examples/tabs-2/i2.png +0 -0
  296. package/payload/starter/_basic/examples/tabs-2/i3-white.png +0 -0
  297. package/payload/starter/_basic/examples/tabs-2/i3.png +0 -0
  298. package/payload/starter/_basic/examples/tabs-2/i4-white.png +0 -0
  299. package/payload/starter/_basic/examples/tabs-2/i4.png +0 -0
  300. package/payload/starter/_basic/examples/tabs-2/i5-white.png +0 -0
  301. package/payload/starter/_basic/examples/tabs-2/i5.png +0 -0
  302. package/payload/starter/_basic/examples/tabs-2/lamp-on.png +0 -0
  303. package/payload/starter/_basic/examples/tabs-2/lamp.png +0 -0
  304. package/payload/starter/_basic/examples/tabs-2/search.svg +2 -0
  305. package/payload/starter/_basic/examples/tabs-2.htm +188 -0
  306. package/payload/starter/_basic/examples/tabs.htm +300 -0
  307. package/payload/starter/_basic/examples/tag-input.htm +242 -0
  308. package/payload/starter/_basic/examples/tap-effect.htm +100 -0
  309. package/payload/starter/_basic/examples/textarea-b.htm +76 -0
  310. package/payload/starter/_basic/examples/time-line.htm +226 -0
  311. package/payload/starter/_basic/examples/tiny-select.htm +86 -0
  312. package/payload/starter/_basic/examples/tiny-table.htm +109 -0
  313. package/payload/starter/_basic/examples/toast.htm +262 -0
  314. package/payload/starter/_basic/examples/toggle-2.htm +163 -0
  315. package/payload/starter/_basic/examples/toggle-3.htm +218 -0
  316. package/payload/starter/_basic/examples/toggle.htm +93 -0
  317. package/payload/starter/_basic/examples/tooltip-2.htm +177 -0
  318. package/payload/starter/_basic/examples/tooltip-3.htm +212 -0
  319. package/payload/starter/_basic/examples/tooltip.htm +124 -0
  320. package/payload/starter/_basic/examples/tree-view.htm +285 -0
  321. package/payload/starter/_basic/examples/ui-effects.htm +463 -0
  322. package/payload/starter/_basic/examples/ui-standards.htm +261 -0
  323. package/payload/starter/_basic/examples/unfinished-login-page-dark-supabase.htm +221 -0
  324. package/payload/starter/_basic/examples/unfinished-login-page-supabase.htm +221 -0
  325. package/payload/starter/_basic/examples/url-input-b.htm +85 -0
  326. package/payload/starter/_basic/examples/web-view.htm +241 -0
  327. package/payload/starter/_basic/min/action-button.min.js +2 -0
  328. package/payload/starter/_basic/min/action-tab-bar.min.js +2 -0
  329. package/payload/starter/_basic/min/app-bar.min.js +2 -0
  330. package/payload/starter/_basic/min/badge-v2.min.js +2 -0
  331. package/payload/starter/_basic/min/bottom-bar.min.js +2 -0
  332. package/payload/starter/_basic/min/breadcrumbs.min.js +2 -0
  333. package/payload/starter/_basic/min/chart-box.min.js +2 -0
  334. package/payload/starter/_basic/min/check-box.min.js +2 -0
  335. package/payload/starter/_basic/min/context-menu.min.js +2 -0
  336. package/payload/starter/_basic/min/currency-input-b.min.js +2 -0
  337. package/payload/starter/_basic/min/data-table.min.js +2 -0
  338. package/payload/starter/_basic/min/dialog.min.js +2 -0
  339. package/payload/starter/_basic/min/email-input-b.min.js +2 -0
  340. package/payload/starter/_basic/min/filters.min.js +2 -0
  341. package/payload/starter/_basic/min/form.min.js +2 -0
  342. package/payload/starter/_basic/min/full-screen-select.min.js +2 -0
  343. package/payload/starter/_basic/min/gauge.min.js +2 -0
  344. package/payload/starter/_basic/min/hold-to-confirm-button.min.js +2 -0
  345. package/payload/starter/_basic/min/input-b.min.js +2 -0
  346. package/payload/starter/_basic/min/item-list.min.js +2 -0
  347. package/payload/starter/_basic/min/label-editor.min.js +2 -0
  348. package/payload/starter/_basic/min/left-menu.min.js +2 -0
  349. package/payload/starter/_basic/min/line-progress-bar.min.js +2 -0
  350. package/payload/starter/_basic/min/loading-screen.min.js +2 -0
  351. package/payload/starter/_basic/min/login-page-v2.min.js +2 -0
  352. package/payload/starter/_basic/min/mini-graph-box.min.js +2 -0
  353. package/payload/starter/_basic/min/notice.min.js +2 -0
  354. package/payload/starter/_basic/min/number-input-b.min.js +2 -0
  355. package/payload/starter/_basic/min/numeric-keyboard.min.js +2 -0
  356. package/payload/starter/_basic/min/page-control.min.js +2 -0
  357. package/payload/starter/_basic/min/page-header.min.js +2 -0
  358. package/payload/starter/_basic/min/password-input-b.min.js +2 -0
  359. package/payload/starter/_basic/min/period-bar.min.js +2 -0
  360. package/payload/starter/_basic/min/phone-input-b.min.js +2 -0
  361. package/payload/starter/_basic/min/progress-bar.min.js +2 -0
  362. package/payload/starter/_basic/min/property-panel.min.js +2 -0
  363. package/payload/starter/_basic/min/radio-button.min.js +2 -0
  364. package/payload/starter/_basic/min/rich-text-editor.min.js +2 -0
  365. package/payload/starter/_basic/min/scrolling-text.min.js +2 -0
  366. package/payload/starter/_basic/min/search-input-v2.min.js +2 -0
  367. package/payload/starter/_basic/min/search-results.min.js +2 -0
  368. package/payload/starter/_basic/min/select-box.min.js +2 -0
  369. package/payload/starter/_basic/min/select-color.min.js +2 -0
  370. package/payload/starter/_basic/min/select-date.min.js +2 -0
  371. package/payload/starter/_basic/min/select-file.min.js +2 -0
  372. package/payload/starter/_basic/min/select-time.min.js +2 -0
  373. package/payload/starter/_basic/min/settings-row.min.js +2 -0
  374. package/payload/starter/_basic/min/side-panel.min.js +2 -0
  375. package/payload/starter/_basic/min/slider-field.min.js +2 -0
  376. package/payload/starter/_basic/min/slider.min.js +2 -0
  377. package/payload/starter/_basic/min/smart-button.min.js +2 -0
  378. package/payload/starter/_basic/min/smart-table.min.js +2 -0
  379. package/payload/starter/_basic/min/sortable-list.min.js +2 -0
  380. package/payload/starter/_basic/min/spark-line-box.min.js +2 -0
  381. package/payload/starter/_basic/min/stepper.min.js +2 -0
  382. package/payload/starter/_basic/min/tabs.min.js +2 -0
  383. package/payload/starter/_basic/min/tag-input.min.js +2 -0
  384. package/payload/starter/_basic/min/tap-effect.min.js +2 -0
  385. package/payload/starter/_basic/min/textarea-b.min.js +2 -0
  386. package/payload/starter/_basic/min/time-line.min.js +2 -0
  387. package/payload/starter/_basic/min/tiny-select.min.js +2 -0
  388. package/payload/starter/_basic/min/tiny-table.min.js +2 -0
  389. package/payload/starter/_basic/min/toast.min.js +2 -0
  390. package/payload/starter/_basic/min/toggle.min.js +2 -0
  391. package/payload/starter/_basic/min/tooltip.min.js +2 -0
  392. package/payload/starter/_basic/min/tree-view.min.js +2 -0
  393. package/payload/starter/_basic/min/ui-effects.min.js +2 -0
  394. package/payload/starter/_basic/min/ui-standards.min.js +2 -0
  395. package/payload/starter/_basic/min/url-input-b.min.js +2 -0
  396. package/payload/starter/_basic/min/web-view.min.js +2 -0
  397. package/payload/starter/_basic/tools/build.js +175 -0
  398. package/payload/starter/_basic/tools/check.js +336 -0
  399. package/payload/starter/app/app.js +27 -0
  400. package/payload/starter/assets/.gitkeep +0 -0
  401. package/payload/starter/gitignore +3 -0
  402. package/payload/starter/index.htm +23 -0
  403. package/payload/templates/booking/TEMPLATE.md +77 -0
  404. package/payload/templates/booking/app/app.js +722 -0
  405. package/payload/templates/booking/app/settings.js +52 -0
  406. package/payload/templates/booking/app/store.js +265 -0
  407. package/payload/templates/booking/app/texts.js +148 -0
  408. package/payload/templates/booking/assets/app-icon.svg +1 -0
  409. package/payload/templates/booking/assets/tabs/account.svg +1 -0
  410. package/payload/templates/booking/assets/tabs/appointments.svg +1 -0
  411. package/payload/templates/booking/assets/tabs/home.svg +1 -0
  412. package/payload/templates/booking/assets/tabs/services.svg +1 -0
  413. package/payload/templates/booking/components/booking-ui.js +252 -0
  414. package/payload/templates/booking/index.htm +53 -0
  415. package/payload/templates/booking/pages/account.js +124 -0
  416. package/payload/templates/booking/pages/appointments.js +141 -0
  417. package/payload/templates/booking/pages/book.js +231 -0
  418. package/payload/templates/booking/pages/home.js +99 -0
  419. package/payload/templates/booking/pages/services.js +79 -0
  420. package/payload/templates/classic/TEMPLATE.md +104 -0
  421. package/payload/templates/classic/app/app.js +779 -0
  422. package/payload/templates/classic/app/settings.js +77 -0
  423. package/payload/templates/classic/assets/_attribute.txt +37 -0
  424. package/payload/templates/classic/assets/cards/dill.png +0 -0
  425. package/payload/templates/classic/assets/cards/fennel.png +0 -0
  426. package/payload/templates/classic/assets/cards/juniper.png +0 -0
  427. package/payload/templates/classic/assets/cards/olives.png +0 -0
  428. package/payload/templates/classic/assets/cards/oregano.png +0 -0
  429. package/payload/templates/classic/assets/cards/pepper.png +0 -0
  430. package/payload/templates/classic/assets/cards/rosehip.png +0 -0
  431. package/payload/templates/classic/assets/categories/cappuccino.png +0 -0
  432. package/payload/templates/classic/assets/categories/chocolate-milk.png +0 -0
  433. package/payload/templates/classic/assets/categories/coffee-cup.png +0 -0
  434. package/payload/templates/classic/assets/categories/coffee.png +0 -0
  435. package/payload/templates/classic/assets/categories/frappe.png +0 -0
  436. package/payload/templates/classic/assets/categories/iced-caffee.png +0 -0
  437. package/payload/templates/classic/assets/categories/milkshake.png +0 -0
  438. package/payload/templates/classic/assets/categories/orange-juice.png +0 -0
  439. package/payload/templates/classic/assets/categories/tea.png +0 -0
  440. package/payload/templates/classic/assets/example-tabs/coffee.png +0 -0
  441. package/payload/templates/classic/assets/example-tabs/i1-white.png +0 -0
  442. package/payload/templates/classic/assets/example-tabs/i1.png +0 -0
  443. package/payload/templates/classic/assets/example-tabs/i2-white.png +0 -0
  444. package/payload/templates/classic/assets/example-tabs/i2.png +0 -0
  445. package/payload/templates/classic/assets/example-tabs/i3-white.png +0 -0
  446. package/payload/templates/classic/assets/example-tabs/i3.png +0 -0
  447. package/payload/templates/classic/assets/example-tabs/i4-white.png +0 -0
  448. package/payload/templates/classic/assets/example-tabs/i4.png +0 -0
  449. package/payload/templates/classic/assets/example-tabs/i5-white.png +0 -0
  450. package/payload/templates/classic/assets/example-tabs/i5.png +0 -0
  451. package/payload/templates/classic/assets/example-tabs/lamp-on.png +0 -0
  452. package/payload/templates/classic/assets/example-tabs/lamp.png +0 -0
  453. package/payload/templates/classic/assets/example-tabs/search.svg +2 -0
  454. package/payload/templates/classic/assets/files/ai.png +0 -0
  455. package/payload/templates/classic/assets/files/doc.png +0 -0
  456. package/payload/templates/classic/assets/files/folder.png +0 -0
  457. package/payload/templates/classic/assets/files/js.png +0 -0
  458. package/payload/templates/classic/assets/files/pdf.png +0 -0
  459. package/payload/templates/classic/assets/files/txt.png +0 -0
  460. package/payload/templates/classic/assets/files/xls.png +0 -0
  461. package/payload/templates/classic/assets/icons/arrow-drop.svg +3 -0
  462. package/payload/templates/classic/assets/icons/arrow-rise.svg +3 -0
  463. package/payload/templates/classic/assets/icons/download.svg +18 -0
  464. package/payload/templates/classic/assets/icons/lamp-on.png +0 -0
  465. package/payload/templates/classic/assets/icons/lamp.png +0 -0
  466. package/payload/templates/classic/assets/icons/lock-small.png +0 -0
  467. package/payload/templates/classic/assets/icons/lock.png +0 -0
  468. package/payload/templates/classic/assets/icons/logo.png +0 -0
  469. package/payload/templates/classic/assets/icons/trash-red.svg +2 -0
  470. package/payload/templates/classic/assets/icons/trash.svg +2 -0
  471. package/payload/templates/classic/assets/menu/t1.png +0 -0
  472. package/payload/templates/classic/assets/menu/t10.png +0 -0
  473. package/payload/templates/classic/assets/menu/t11.png +0 -0
  474. package/payload/templates/classic/assets/menu/t2.png +0 -0
  475. package/payload/templates/classic/assets/menu/t3.png +0 -0
  476. package/payload/templates/classic/assets/menu/t4.png +0 -0
  477. package/payload/templates/classic/assets/menu/t5.png +0 -0
  478. package/payload/templates/classic/assets/menu/t6.png +0 -0
  479. package/payload/templates/classic/assets/menu/t7.png +0 -0
  480. package/payload/templates/classic/assets/menu/t8.png +0 -0
  481. package/payload/templates/classic/assets/menu/t9.png +0 -0
  482. package/payload/templates/classic/assets/products/brokoli.png +0 -0
  483. package/payload/templates/classic/assets/products/cilek.png +0 -0
  484. package/payload/templates/classic/assets/products/domates.png +0 -0
  485. package/payload/templates/classic/assets/products/elma.png +0 -0
  486. package/payload/templates/classic/assets/products/havuc.png +0 -0
  487. package/payload/templates/classic/assets/products/karpuz.png +0 -0
  488. package/payload/templates/classic/assets/products/limon.png +0 -0
  489. package/payload/templates/classic/assets/products/muz.png +0 -0
  490. package/payload/templates/classic/assets/products/nar.png +0 -0
  491. package/payload/templates/classic/assets/products/patlican.png +0 -0
  492. package/payload/templates/classic/assets/products/yabanmersini.png +0 -0
  493. package/payload/templates/classic/assets/products/yesilbiber.png +0 -0
  494. package/payload/templates/classic/assets/tab-bar/settings.png +0 -0
  495. package/payload/templates/classic/assets/tab-bar/status.png +0 -0
  496. package/payload/templates/classic/assets/tab-bar/transactions.png +0 -0
  497. package/payload/templates/classic/assets/tabs/grid.png +0 -0
  498. package/payload/templates/classic/assets/tabs/grids.png +0 -0
  499. package/payload/templates/classic/assets/tabs/home.png +0 -0
  500. package/payload/templates/classic/assets/tabs/homes.png +0 -0
  501. package/payload/templates/classic/assets/tabs/search.png +0 -0
  502. package/payload/templates/classic/assets/tabs/searchs.png +0 -0
  503. package/payload/templates/classic/assets/tabs/settings.png +0 -0
  504. package/payload/templates/classic/assets/tabs/settingss.png +0 -0
  505. package/payload/templates/classic/assets/tabs/tasks.png +0 -0
  506. package/payload/templates/classic/assets/tabs/taskss.png +0 -0
  507. package/payload/templates/classic/html/privacy.htm +58 -0
  508. package/payload/templates/classic/index.htm +70 -0
  509. package/payload/templates/classic/pages/dialogs.js +205 -0
  510. package/payload/templates/classic/pages/example.js +296 -0
  511. package/payload/templates/classic/pages/examples.js +148 -0
  512. package/payload/templates/classic/pages/home.js +268 -0
  513. package/payload/templates/classic/pages/info-pages.js +95 -0
  514. package/payload/templates/classic/pages/lock.js +70 -0
  515. package/payload/templates/classic/pages/search.js +153 -0
  516. package/payload/templates/classic/pages/settings.js +184 -0
  517. package/payload/templates/classic/pages/tasks.js +221 -0
  518. package/payload/templates/classic/pages/template-pages.js +240 -0
  519. package/payload/templates/coffee-shop/TEMPLATE.md +63 -0
  520. package/payload/templates/coffee-shop/app/app.js +713 -0
  521. package/payload/templates/coffee-shop/app/settings.js +20 -0
  522. package/payload/templates/coffee-shop/app/store.js +52 -0
  523. package/payload/templates/coffee-shop/assets/cappuccino.png +0 -0
  524. package/payload/templates/coffee-shop/assets/chocolate-milk.png +0 -0
  525. package/payload/templates/coffee-shop/assets/coffee-art/cocoa.svg +1 -0
  526. package/payload/templates/coffee-shop/assets/coffee-art/filter.svg +1 -0
  527. package/payload/templates/coffee-shop/assets/coffee-art/frappe.svg +1 -0
  528. package/payload/templates/coffee-shop/assets/coffee-art/iced.svg +1 -0
  529. package/payload/templates/coffee-shop/assets/coffee-art/latte.svg +1 -0
  530. package/payload/templates/coffee-shop/assets/coffee-art/tea.svg +1 -0
  531. package/payload/templates/coffee-shop/assets/coffee.png +0 -0
  532. package/payload/templates/coffee-shop/assets/credits.txt +41 -0
  533. package/payload/templates/coffee-shop/assets/fonts/OFL.txt +93 -0
  534. package/payload/templates/coffee-shop/assets/fonts/gelasio-OFL.txt +93 -0
  535. package/payload/templates/coffee-shop/assets/fonts/gelasio.ttf +0 -0
  536. package/payload/templates/coffee-shop/assets/frappe.png +0 -0
  537. package/payload/templates/coffee-shop/assets/iced-caffee.png +0 -0
  538. package/payload/templates/coffee-shop/assets/tabs/cart.svg +1 -0
  539. package/payload/templates/coffee-shop/assets/tabs/home.svg +1 -0
  540. package/payload/templates/coffee-shop/assets/tabs/menu.svg +1 -0
  541. package/payload/templates/coffee-shop/assets/tabs/rewards.svg +1 -0
  542. package/payload/templates/coffee-shop/assets/tea.png +0 -0
  543. package/payload/templates/coffee-shop/components/coffee-ui.js +246 -0
  544. package/payload/templates/coffee-shop/index.htm +55 -0
  545. package/payload/templates/coffee-shop/pages/cart.js +82 -0
  546. package/payload/templates/coffee-shop/pages/drink.js +74 -0
  547. package/payload/templates/coffee-shop/pages/home.js +54 -0
  548. package/payload/templates/coffee-shop/pages/menu.js +53 -0
  549. package/payload/templates/coffee-shop/pages/rewards.js +38 -0
  550. package/payload/templates/forms/TEMPLATE.md +12 -0
  551. package/payload/templates/forms/app/app.js +30 -0
  552. package/payload/templates/forms/appointment-form.htm +969 -0
  553. package/payload/templates/forms/assets/error.png +0 -0
  554. package/payload/templates/forms/assets/logo.png +0 -0
  555. package/payload/templates/forms/assets/logo2.png +0 -0
  556. package/payload/templates/forms/assets/mail.png +0 -0
  557. package/payload/templates/forms/assets/success.png +0 -0
  558. package/payload/templates/forms/contact-form-iframe.htm +24 -0
  559. package/payload/templates/forms/contact-form-table.sql +11 -0
  560. package/payload/templates/forms/contact-form-to-mail.htm +358 -0
  561. package/payload/templates/forms/contact-form-to-supabase.htm +396 -0
  562. package/payload/templates/forms/dark-contact-form.htm +623 -0
  563. package/payload/templates/forms/event-registration-form.htm +1056 -0
  564. package/payload/templates/forms/feedback-form.htm +813 -0
  565. package/payload/templates/forms/order-form.htm +1187 -0
  566. package/payload/templates/forms/recruitment-form.htm +698 -0
  567. package/payload/templates/forms/service/PHPMailer/Exception.php +40 -0
  568. package/payload/templates/forms/service/PHPMailer/LICENSE +502 -0
  569. package/payload/templates/forms/service/PHPMailer/PHPMailer.php +5586 -0
  570. package/payload/templates/forms/service/PHPMailer/SMTP.php +1617 -0
  571. package/payload/templates/forms/service/readme.md +162 -0
  572. package/payload/templates/forms/service/send-form-mail.php +941 -0
  573. package/payload/templates/forms/support-ticket-form.htm +908 -0
  574. package/payload/templates/panel/TEMPLATE.md +16 -0
  575. package/payload/templates/panel/assets/_Material Symbols & Icons - Google Fonts.webloc +8 -0
  576. package/payload/templates/panel/assets/arrow_down.png +0 -0
  577. package/payload/templates/panel/assets/close.png +0 -0
  578. package/payload/templates/panel/assets/left-menu/bolt.png +0 -0
  579. package/payload/templates/panel/assets/left-menu/brick.png +0 -0
  580. package/payload/templates/panel/assets/left-menu/code.png +0 -0
  581. package/payload/templates/panel/assets/left-menu/dashboard.png +0 -0
  582. package/payload/templates/panel/assets/left-menu/data-table.png +0 -0
  583. package/payload/templates/panel/assets/left-menu/extension.png +0 -0
  584. package/payload/templates/panel/assets/left-menu/home.png +0 -0
  585. package/payload/templates/panel/assets/left-menu/reports.png +0 -0
  586. package/payload/templates/panel/assets/left-menu/setting.png +0 -0
  587. package/payload/templates/panel/assets/left-menu/url.png +0 -0
  588. package/payload/templates/panel/assets/light.png +0 -0
  589. package/payload/templates/panel/assets/maybe.png +0 -0
  590. package/payload/templates/panel/assets/panel-icon.png +0 -0
  591. package/payload/templates/panel/assets/top-bar/add.png +0 -0
  592. package/payload/templates/panel/assets/top-bar/add.svg +1 -0
  593. package/payload/templates/panel/assets/top-bar/apps.png +0 -0
  594. package/payload/templates/panel/assets/top-bar/apps.svg +1 -0
  595. package/payload/templates/panel/assets/top-bar/arrow-down.svg +1 -0
  596. package/payload/templates/panel/assets/top-bar/bell.svg +1 -0
  597. package/payload/templates/panel/assets/top-bar/bookmark.png +0 -0
  598. package/payload/templates/panel/assets/top-bar/bookmark.svg +1 -0
  599. package/payload/templates/panel/assets/top-bar/cancel.png +0 -0
  600. package/payload/templates/panel/assets/top-bar/close.svg +1 -0
  601. package/payload/templates/panel/assets/top-bar/comment.png +0 -0
  602. package/payload/templates/panel/assets/top-bar/filter.png +0 -0
  603. package/payload/templates/panel/assets/top-bar/keyboard.svg +1 -0
  604. package/payload/templates/panel/assets/top-bar/notification.png +0 -0
  605. package/payload/templates/panel/assets/top-bar/search.png +0 -0
  606. package/payload/templates/panel/assets/top-bar/search.svg +1 -0
  607. package/payload/templates/panel/assets/top-bar/user.png +0 -0
  608. package/payload/templates/panel/assets/top-bar/user.svg +1 -0
  609. package/payload/templates/panel/assets/warning.png +0 -0
  610. package/payload/templates/panel/common/bridge.js +1 -0
  611. package/payload/templates/panel/common/bridge.min.js +0 -0
  612. package/payload/templates/panel/common/components.js +12 -0
  613. package/payload/templates/panel/common/full-view.js +107 -0
  614. package/payload/templates/panel/common/full-view.min.js +1 -0
  615. package/payload/templates/panel/common/main-view.js +53 -0
  616. package/payload/templates/panel/common/main-view.min.js +1 -0
  617. package/payload/templates/panel/common/module-page.js +46 -0
  618. package/payload/templates/panel/common/module-page.min.js +1 -0
  619. package/payload/templates/panel/common/right-view.js +77 -0
  620. package/payload/templates/panel/common/right-view.min.js +1 -0
  621. package/payload/templates/panel/common/start-page.js +31 -0
  622. package/payload/templates/panel/common/start-page.min.js +1 -0
  623. package/payload/templates/panel/common/theme.js +491 -0
  624. package/payload/templates/panel/common/top-bar-v25-07-29-1.js +330 -0
  625. package/payload/templates/panel/common/top-bar-v25-07-29-2.js +265 -0
  626. package/payload/templates/panel/common/top-bar.js +855 -0
  627. package/payload/templates/panel/common/top-bar.min.js +1 -0
  628. package/payload/templates/panel/common/ui-standards.css +77 -0
  629. package/payload/templates/panel/common/ui-standards.js +133 -0
  630. package/payload/templates/panel/common/ui-standards.min.css +1 -0
  631. package/payload/templates/panel/common/ui-standards.min.js +1 -0
  632. package/payload/templates/panel/index.htm +642 -0
  633. package/payload/templates/panel/managers/database.js +1 -0
  634. package/payload/templates/panel/managers/database.min.js +1 -0
  635. package/payload/templates/panel/managers/login.js +2 -0
  636. package/payload/templates/panel/managers/login.min.js +1 -0
  637. package/payload/templates/panel/module1/empty-main.htm +27 -0
  638. package/payload/templates/panel/module10/greenhouse.htm +1362 -0
  639. package/payload/templates/panel/module11/arduino-projects.htm +1125 -0
  640. package/payload/templates/panel/module2/empty-full.htm +27 -0
  641. package/payload/templates/panel/module3/empty-right.htm +27 -0
  642. package/payload/templates/panel/module4/empty-main-topbar.htm +27 -0
  643. package/payload/templates/panel/module5/empty-right-topbar.htm +27 -0
  644. package/payload/templates/panel/module6/energy-hub.htm +1508 -0
  645. package/payload/templates/panel/module7/3d-printers.htm +1259 -0
  646. package/payload/templates/panel/module8/cold-rooms.htm +1251 -0
  647. package/payload/templates/panel/module9/elevator-fleet.htm +1489 -0
  648. package/payload/templates/panel/pages/_page-template.js +36 -0
  649. package/payload/templates/panel/pages/_page-template.min.js +1 -0
  650. package/payload/templates/panel/pages/activity.js +1072 -0
  651. package/payload/templates/panel/pages/contents.js +1555 -0
  652. package/payload/templates/panel/pages/contents.min.js +1 -0
  653. package/payload/templates/panel/pages/customers.js +1171 -0
  654. package/payload/templates/panel/pages/edit-user.js +381 -0
  655. package/payload/templates/panel/pages/edit-user.min.js +1 -0
  656. package/payload/templates/panel/pages/edit-users-table.min.js +1 -0
  657. package/payload/templates/panel/pages/home.js +637 -0
  658. package/payload/templates/panel/pages/home.min.js +1 -0
  659. package/payload/templates/panel/pages/media.js +1538 -0
  660. package/payload/templates/panel/pages/notifications.js +542 -0
  661. package/payload/templates/panel/pages/notifications.min.js +1 -0
  662. package/payload/templates/panel/pages/orders.js +1147 -0
  663. package/payload/templates/panel/pages/products.js +1281 -0
  664. package/payload/templates/panel/pages/reports.js +1138 -0
  665. package/payload/templates/panel/pages/reports.min.js +1 -0
  666. package/payload/templates/panel/pages/roles.js +1096 -0
  667. package/payload/templates/panel/pages/settings.js +1462 -0
  668. package/payload/templates/panel/pages/settings.min.js +1 -0
  669. package/payload/templates/panel/pages/user-actions.js +456 -0
  670. package/payload/templates/panel/pages/user-actions.min.js +2 -0
  671. package/payload/templates/panel/pages/user-list.js +1113 -0
  672. package/payload/templates/panel/pages/users.js +334 -0
  673. package/payload/templates/panel/pages/users.min.js +1 -0
  674. package/payload/templates/shop/TEMPLATE.md +69 -0
  675. package/payload/templates/shop/app/app.js +727 -0
  676. package/payload/templates/shop/app/art.js +89 -0
  677. package/payload/templates/shop/app/settings.js +45 -0
  678. package/payload/templates/shop/app/store.js +239 -0
  679. package/payload/templates/shop/app/texts.js +232 -0
  680. package/payload/templates/shop/assets/app-icon.svg +1 -0
  681. package/payload/templates/shop/assets/tabs/account.svg +1 -0
  682. package/payload/templates/shop/assets/tabs/cart.svg +1 -0
  683. package/payload/templates/shop/assets/tabs/home.svg +1 -0
  684. package/payload/templates/shop/assets/tabs/shop.svg +1 -0
  685. package/payload/templates/shop/components/shop-ui.js +343 -0
  686. package/payload/templates/shop/index.htm +57 -0
  687. package/payload/templates/shop/pages/account.js +190 -0
  688. package/payload/templates/shop/pages/cart.js +116 -0
  689. package/payload/templates/shop/pages/checkout.js +134 -0
  690. package/payload/templates/shop/pages/favorites.js +37 -0
  691. package/payload/templates/shop/pages/home.js +86 -0
  692. package/payload/templates/shop/pages/orders.js +132 -0
  693. package/payload/templates/shop/pages/product.js +168 -0
  694. package/payload/templates/shop/pages/shop.js +113 -0
  695. package/payload/templates/starter/TEMPLATE.md +107 -0
  696. package/payload/templates/starter/app/app.js +660 -0
  697. package/payload/templates/starter/app/settings.js +57 -0
  698. package/payload/templates/starter/assets/app-icon.svg +5 -0
  699. package/payload/templates/starter/assets/products/brokoli.png +0 -0
  700. package/payload/templates/starter/assets/products/cilek.png +0 -0
  701. package/payload/templates/starter/assets/products/domates.png +0 -0
  702. package/payload/templates/starter/assets/products/elma.png +0 -0
  703. package/payload/templates/starter/assets/products/havuc.png +0 -0
  704. package/payload/templates/starter/assets/products/karpuz.png +0 -0
  705. package/payload/templates/starter/assets/products/limon.png +0 -0
  706. package/payload/templates/starter/assets/products/muz.png +0 -0
  707. package/payload/templates/starter/assets/products/nar.png +0 -0
  708. package/payload/templates/starter/assets/products/patlican.png +0 -0
  709. package/payload/templates/starter/assets/products/yabanmersini.png +0 -0
  710. package/payload/templates/starter/assets/products/yesilbiber.png +0 -0
  711. package/payload/templates/starter/assets/tabs/grid.png +0 -0
  712. package/payload/templates/starter/assets/tabs/grids.png +0 -0
  713. package/payload/templates/starter/assets/tabs/home.png +0 -0
  714. package/payload/templates/starter/assets/tabs/homes.png +0 -0
  715. package/payload/templates/starter/assets/tabs/settings.png +0 -0
  716. package/payload/templates/starter/assets/tabs/settingss.png +0 -0
  717. package/payload/templates/starter/assets/tabs/tasks.png +0 -0
  718. package/payload/templates/starter/assets/tabs/taskss.png +0 -0
  719. package/payload/templates/starter/html/about.htm +54 -0
  720. package/payload/templates/starter/index.htm +57 -0
  721. package/payload/templates/starter/pages/about.js +23 -0
  722. package/payload/templates/starter/pages/home.js +81 -0
  723. package/payload/templates/starter/pages/product.js +45 -0
  724. package/payload/templates/starter/pages/products.js +61 -0
  725. package/payload/templates/starter/pages/settings.js +103 -0
  726. package/payload/templates/starter/pages/tasks.js +187 -0
  727. package/payload/templates/starter/pages/website.js +29 -0
@@ -0,0 +1,1555 @@
1
+ /* Bismillah */
2
+
3
+ /*
4
+
5
+ Contents Page (Template) - v26.09
6
+
7
+ - Pages, blog posts and banners of the site: summary, type tabs with counts, filters and a content table.
8
+ - Content editor (right view):
9
+ - Title, URL (slug, created from the title), excerpt and the text (word count, reading time).
10
+ - Type options: Page (show in the menu), Post (category, tags), Banner (link, placement).
11
+ - Publishing: Draft, Published, Scheduled (date and time), Archived. Author.
12
+ - Featured image from the Media Library.
13
+ - SEO: meta title, meta description, search result preview and a checklist.
14
+ - Preview in a new window, duplicate (as a draft), delete (hold to confirm).
15
+ - Closing with unsaved changes asks first.
16
+ - Scheduled contents are published when their time comes (checked when the list is shown).
17
+ - Test data: About 40 contents, created one time. Changes are kept while the panel is open.
18
+ Replace the "CONTENT SERVICE" functions with your service.
19
+
20
+ COMPONENTS:
21
+ - Tabs (comp-m4), SearchInput, TinySelect (comp-m2): Filters
22
+ - SmartTable (comp-m3): Content list
23
+ - InputB (comp-m2): Editor fields
24
+ - RadioButton, CheckBox (comp-m3): Status, options
25
+ - SelectDate, SelectTime (comp-m4): Schedule
26
+ - SmartButton (comp-m4), HoldToConfirmButton (comp-m3): Actions
27
+ - Dialog, LoadingScreen (comp-m4; Theme.confirm, waiting): Confirm, saving
28
+
29
+ */
30
+
31
+ ContentsPageDefaults = {
32
+ color: "transparent",
33
+ openContentId: null, // Opens the editor of this content. "new": New content (Ex: from the top bar)
34
+ };
35
+
36
+ const ContentsPage = function(params = {}) {
37
+
38
+ // BOX: Page container
39
+ let box = startPage(params, ContentsPageDefaults, mainView);
40
+
41
+ mainView.setKey(ContentsPage.KEY);
42
+
43
+ // *** PRIVATE VARIABLES:
44
+
45
+ const ASSETS = "assets/";
46
+ const LIB_PATH = "_basic/";
47
+ const S = ContentsPage.STYLE;
48
+ const TYPES = ContentsPage.TYPES;
49
+ const STATUSES = ContentsPage.STATUSES;
50
+
51
+ const TYPE_TABS = ["", "page", "post", "banner"]; // "": All
52
+
53
+ const filter = {
54
+ type: "",
55
+ status: "",
56
+ author: "",
57
+ search: "",
58
+ };
59
+
60
+ let searchTimer = null;
61
+
62
+ // Components
63
+ let typeTabs;
64
+ let statCards = [];
65
+ let lblResultCount, smartTable;
66
+
67
+ // *** PRIVATE FUNCTIONS:
68
+
69
+ // All filters except the type (used for the tab counts too)
70
+ const matchesFilters = function(content) {
71
+ if (filter.status && content.status != filter.status) return false;
72
+ if (filter.author && content.author != filter.author) return false;
73
+ const search = filter.search.trim().toLowerCase();
74
+ if (search && !(content.title + " " + content.slug + " " + content.tags.join(" ")).toLowerCase().includes(search)) return false;
75
+ return true;
76
+ };
77
+
78
+ const render = function() {
79
+
80
+ ContentsPage.publishDueContents();
81
+
82
+ const list = ContentsPage.getContents().filter(matchesFilters);
83
+
84
+ TYPE_TABS.forEach(function(type, index) {
85
+ const count = (type) ? list.filter(function(content) { return content.type == type; }).length : list.length;
86
+ typeTabs.setCount(index, count);
87
+ });
88
+
89
+ const shown = (filter.type) ? list.filter(function(content) { return content.type == filter.type; }) : list;
90
+
91
+ smartTable.setItemDataList(shown.map(function(content) {
92
+ return {
93
+ id: content.id,
94
+ title: content.title,
95
+ type: TYPES[content.type].label,
96
+ status: STATUSES[content.status].label,
97
+ author: content.author,
98
+ updated: ContentsPage.formatDateTime(content.updatedAt), // Sortable text
99
+ views: content.views,
100
+ seo: (ContentsPage.getSeoChecks(content).every(function(check) { return check.ok; })) ? "Good" : "Check",
101
+ };
102
+ }));
103
+
104
+ lblResultCount.text = shown.length + " contents";
105
+
106
+ renderSummary();
107
+
108
+ };
109
+
110
+ const renderSummary = function() {
111
+
112
+ const contents = ContentsPage.getContents();
113
+ const count = function(status) { return contents.filter(function(content) { return content.status == status; }).length; };
114
+ const scheduled = contents.filter(function(content) { return content.status == "scheduled"; }).sort(function(a, b) { return a.publishAt - b.publishAt; });
115
+ const seoIssues = contents.filter(function(content) {
116
+ return content.status != "archived" && !ContentsPage.getSeoChecks(content).every(function(check) { return check.ok; });
117
+ });
118
+ const weekAgo = Date.now() - 7 * ContentsPage.DAY;
119
+
120
+ const values = [
121
+ { value: count("published"), desc: contents.filter(function(c) { return c.status == "published" && c.publishAt > weekAgo; }).length + " published this week" },
122
+ { value: count("draft"), desc: "Not visible on the site" },
123
+ { value: scheduled.length, desc: (scheduled.length) ? "Next: " + ContentsPage.formatDateTime(scheduled[0].publishAt) : "Nothing scheduled" },
124
+ { value: seoIssues.length, desc: "Missing SEO info or image" },
125
+ ];
126
+
127
+ statCards.forEach(function(card, index) {
128
+ card.lblValue.text = String(values[index].value);
129
+ card.lblDesc.text = values[index].desc;
130
+ });
131
+
132
+ };
133
+
134
+ const exportCSV = function() {
135
+
136
+ const rows = smartTable.visibleItemDataList; // WHY: Also uses the sort and the search of the table.
137
+ const quote = function(value) { return "\"" + String(value).replace(/"/g, "\"\"") + "\""; };
138
+ const lines = ["id,title,type,status,author,updated,views,seo"].concat(rows.map(function(row) {
139
+ return [row.id, row.title, row.type, row.status, row.author, row.updated, row.views, row.seo].map(quote).join(",");
140
+ }));
141
+
142
+ const link = document.createElement("a");
143
+ link.href = URL.createObjectURL(new Blob([lines.join("\n")], { type: "text/csv" }));
144
+ link.download = "contents-" + ContentsPage.formatDateTime(Date.now()).slice(0, 10) + ".csv";
145
+ link.click();
146
+ // WHY later: some browsers start the download after click() returns
147
+ const url = link.href;
148
+ setTimeout(function() { URL.revokeObjectURL(url); }, 1000);
149
+
150
+ };
151
+
152
+ const openEditor = function(content, newType) {
153
+ ContentEditor({
154
+ content: content, // null: New content
155
+ newType: newType || filter.type || "post",
156
+ onChange: function() {
157
+ if (box) render();
158
+ },
159
+ });
160
+ };
161
+
162
+ const closeEditor = function() {
163
+ if (rightView.isShown(ContentEditor.KEY)) {
164
+ rightView.hide();
165
+ rightView.clean();
166
+ }
167
+ };
168
+
169
+ // *** VIEW HELPERS:
170
+
171
+ const setFlex = function(obj, flex) {
172
+ obj.elem.style.flex = flex;
173
+ obj.elem.style.minWidth = "0";
174
+ };
175
+
176
+ // *** PUBLIC FUNCTIONS:
177
+
178
+ box.destroy = function() {
179
+
180
+ clearTimeout(searchTimer);
181
+ closeEditor();
182
+
183
+ // WHY: SmartTable and ContextMenu are on the page and have window events. box.remove() does not remove them.
184
+ if (smartTable) smartTable.remove();
185
+ if (box.newMenu) box.newMenu.remove();
186
+
187
+ box.remove();
188
+ box = null;
189
+
190
+ };
191
+
192
+ // *** PAGE VIEW:
193
+
194
+ const initHeader = function() {
195
+
196
+ HGroup({ width: "100%", height: "auto", align: "left center", gap: 16 });
197
+ that.elem.style.flexWrap = "wrap";
198
+ that.elem.style.justifyContent = "space-between";
199
+
200
+ VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
201
+
202
+ Label({ text: "Contents", fontSize: 26, textColor: Ink(0.95) });
203
+ that.elem.style.fontFamily = "opensans-bold";
204
+
205
+ Label({ text: "Pages, blog posts and banners of your site", fontSize: 14, textColor: Ink(0.5) });
206
+
207
+ endGroup();
208
+
209
+ HGroup({ width: "auto", height: "auto", align: "right center", gap: 10 });
210
+
211
+ ContentsPage.createButton("Export CSV", ASSETS + "arrow_down.png", exportCSV);
212
+
213
+ const btnNew = ContentsPage.createButton("New Content", ASSETS + "top-bar/add.png", function() {}, { primary: 1 });
214
+
215
+ const newMenu = ContextMenu({
216
+ items: Object.keys(TYPES).map(function(type) { return { text: "New " + TYPES[type].label, key: type }; }),
217
+ onClick: function(self, item) { openEditor(null, item.key); },
218
+ style: ContentsPage.CONTEXT_MENU_STYLE,
219
+ });
220
+ newMenu.attachTo(btnNew, "click");
221
+ box.newMenu = newMenu;
222
+
223
+ endGroup();
224
+
225
+ endGroup();
226
+
227
+ };
228
+
229
+ const initSummary = function() {
230
+
231
+ const CARD_LIST = [
232
+ { title: "Published", color: STATUSES.published.color },
233
+ { title: "Drafts", color: STATUSES.draft.color },
234
+ { title: "Scheduled", color: STATUSES.scheduled.color },
235
+ { title: "SEO to check", color: T.warning },
236
+ ];
237
+
238
+ HGroup({ width: "100%", height: "auto", align: "left top", gap: 16 });
239
+ that.elem.style.flexWrap = "wrap";
240
+
241
+ CARD_LIST.forEach(function(item, index) {
242
+
243
+ const card = VGroup({ width: "auto", height: "auto", align: "left top", gap: 2, padding: 14, color: S.CARD_COLOR, border: 1, borderColor: S.CARD_BORDER_COLOR, round: 12 });
244
+ setFlex(card, "1 1 200px");
245
+
246
+ Label({ text: item.title, fontSize: 13, textColor: Ink(0.5) });
247
+ card.lblValue = Label({ text: "", fontSize: 26, textColor: item.color });
248
+ card.lblDesc = Label({ text: "", fontSize: 12, textColor: Ink(0.45) });
249
+
250
+ endGroup();
251
+
252
+ statCards.push(card);
253
+
254
+ });
255
+
256
+ endGroup();
257
+
258
+ };
259
+
260
+ const initToolbar = function() {
261
+
262
+ VGroup({ width: "100%", height: "auto", align: "left top", gap: 12, padding: 16, color: S.CARD_COLOR, border: 1, borderColor: S.CARD_BORDER_COLOR, round: 12 });
263
+
264
+ HGroup({ width: "100%", height: "auto", align: "left center", gap: 10 });
265
+ that.elem.style.flexWrap = "wrap";
266
+
267
+ typeTabs = Tabs({
268
+ variant: "pill",
269
+ styleName: T.compStyle,
270
+ tabs: Theme.indexTabs(TYPE_TABS.map(function(type) { return (type) ? TYPES[type].plural : "All"; })), // (the key of a tab is its index: self.value)
271
+ onChange: function(self) {
272
+ filter.type = TYPE_TABS[self.value];
273
+ render();
274
+ },
275
+ style: Theme.tabsStyle({ height: 40, barColor: S.FIELD_COLOR, borderColor: S.CARD_BORDER_COLOR, padding: [12, 6], activeColor: S.PRIMARY_COLOR }),
276
+ });
277
+
278
+ SearchInput({
279
+ width: 240,
280
+ height: 40,
281
+ border: 1,
282
+ borderColor: S.CARD_BORDER_COLOR,
283
+ borderBottomStyle: "1px solid " + S.CARD_BORDER_COLOR,
284
+ round: 8,
285
+ color: S.FIELD_COLOR,
286
+ textColor: Ink(0.9),
287
+ fontSize: 14,
288
+ searchIconSize: 16,
289
+ placeholderText: "Title, URL or tag",
290
+ invertIconColor: T.invertIcon,
291
+ searchIconFile: LIB_PATH + "comp/search-input-v2/search.svg",
292
+ clearIconFile: LIB_PATH + "comp/search-input-v2/clear.svg",
293
+ onSearch: function(text) {
294
+ filter.search = text;
295
+ searchTimer = waitAndRun(searchTimer, render, 150);
296
+ },
297
+ });
298
+ that.position = "relative";
299
+
300
+ ContentsPage.createTinySelect(
301
+ [{ id: "", label: "All statuses" }].concat(Object.keys(STATUSES).map(function(id) { return { id: id, label: STATUSES[id].label }; })),
302
+ function(id) { filter.status = id; render(); }
303
+ );
304
+
305
+ ContentsPage.createTinySelect(
306
+ [{ id: "", label: "All authors" }].concat(ContentsPage.getAuthors().map(function(name) { return { id: name, label: name }; })),
307
+ function(id) { filter.author = id; render(); }
308
+ );
309
+
310
+ // Space
311
+ HGroup({ width: "auto", height: 1 });
312
+ that.elem.style.flex = "1 1 auto";
313
+ endGroup();
314
+
315
+ lblResultCount = Label({ text: "", fontSize: 13, textColor: Ink(0.55) });
316
+
317
+ endGroup();
318
+
319
+ endGroup();
320
+
321
+ };
322
+
323
+ const initTable = function() {
324
+
325
+ HGroup({ width: "100%", height: 640, align: "left top" });
326
+
327
+ smartTable = SmartTable({
328
+ titleDataList: [
329
+ { name: "TITLE", dataTitle: "title", dataType: "string", width: 300, shortable: 1 },
330
+ { name: "TYPE", dataTitle: "type", dataType: "string", width: 100, shortable: 1 },
331
+ { name: "STATUS", dataTitle: "status", dataType: "string", width: 120, shortable: 1 },
332
+ { name: "AUTHOR", dataTitle: "author", dataType: "string", width: 160, shortable: 1 },
333
+ { name: "UPDATED", dataTitle: "updated", dataType: "string", width: 170, shortable: 1 },
334
+ { name: "VIEWS", dataTitle: "views", dataType: "integer", width: 100, shortable: 1 },
335
+ { name: "SEO", dataTitle: "seo", dataType: "string", width: 90, shortable: 1 },
336
+ ],
337
+ itemDataList: [],
338
+ titleHeight: 44,
339
+ itemHeight: 40,
340
+ infoHeight: 56,
341
+ itemLineCount: 13,
342
+ sortByTitleIndex: 4,
343
+ sortDirection: "Z-A", // Last updated first
344
+ onSelect: function(itemData) {
345
+ const content = ContentsPage.getContents().find(function(c) { return c.id == itemData.id; });
346
+ if (content) openEditor(content);
347
+ },
348
+ // WHY: SmartTable writes the raw value. Texts and colors are written here.
349
+ updateCustomItemCell: function(cell, titleDataIndex, data) {
350
+ if (titleDataIndex == 2) {
351
+ const status = ContentsPage.getStatusByLabel(data);
352
+ cell.label.textColor = (status) ? status.color : Ink(0.75);
353
+ }
354
+ if (titleDataIndex == 5 && data !== "") {
355
+ cell.label.text = Number(data).toLocaleString("en-US");
356
+ }
357
+ if (titleDataIndex == 6) {
358
+ cell.label.textColor = (data == "Good") ? S.ACCENT_COLOR : T.warning;
359
+ }
360
+ },
361
+ ...ContentsPage.getSmartTableStyle(LIB_PATH),
362
+ });
363
+
364
+ endGroup();
365
+
366
+ };
367
+
368
+ // *** PAGE INIT CODE:
369
+
370
+ // BOX: Scrollable container
371
+ // WHY: page does not scroll. Scrollable content must be inside a Box with scrollY: 1.
372
+ startBox(0, 0, "100%", "100%", {
373
+ color: "transparent",
374
+ scrollY: 1,
375
+ });
376
+
377
+ VGroup({
378
+ width: "100%",
379
+ height: "auto", // Grows with content, so the Box can scroll.
380
+ align: "left top",
381
+ gap: 16,
382
+ padding: 24,
383
+ });
384
+
385
+ initHeader();
386
+ initSummary();
387
+ initToolbar();
388
+ initTable();
389
+
390
+ endGroup();
391
+
392
+ endBox();
393
+
394
+ render();
395
+
396
+ box.endPage();
397
+
398
+ if (box.openContentId === "new") {
399
+ openEditor(null, "post");
400
+ } else if (box.openContentId !== null) {
401
+ const content = ContentsPage.getContents().find(function(c) { return c.id == box.openContentId; });
402
+ if (content) openEditor(content);
403
+ }
404
+
405
+ return box;
406
+
407
+ };
408
+
409
+ ContentsPage.KEY = "Contents";
410
+
411
+ // *** CONTENT EDITOR (RIGHT VIEW):
412
+
413
+ const ContentEditorDefaults = {
414
+ content: null, // null: New content
415
+ newType: "post", // Type of a new content: "page", "post", "banner"
416
+ onChange: function() {},
417
+ };
418
+
419
+ const ContentEditor = function(params = {}) {
420
+
421
+ // Merge params:
422
+ mergeIntoIfMissing(params, ContentEditorDefaults);
423
+
424
+ params.left = 0;
425
+ params.top = 0;
426
+ params.width = "100%";
427
+ params.height = "100%";
428
+ params.color = T.surfaceDeep;
429
+
430
+ // WHY: content is a live object of the list. startObject() would copy it.
431
+ const content = params.content;
432
+ delete params.content;
433
+
434
+ // BOX: Component container
435
+ let box = startObject(params);
436
+
437
+ const S = ContentsPage.STYLE;
438
+ const TYPES = ContentsPage.TYPES;
439
+ const STATUSES = ContentsPage.STATUSES;
440
+ const escape = ContentsPage.escapeHtml;
441
+
442
+ const isNew = !content;
443
+ const draft = (isNew) ? ContentsPage.createEmptyContent(box.newType) : JSON.parse(JSON.stringify(content));
444
+ const original = JSON.stringify(draft);
445
+ let isSlugEdited = !isNew; // WHY: The slug follows the title only for a new content, until it is changed by the user.
446
+
447
+ const radioList = [];
448
+ let saveTimer = null;
449
+
450
+ // Components
451
+ let inputTitle, inputSlug, lblUrl, inputExcerpt, bodyArea, lblBodyInfo;
452
+ let grpPageOptions, grpPostOptions, grpBannerOptions, inputTags, inputLink;
453
+ let grpSchedule, dateSchedule, timeSchedule;
454
+ let grpImages, inputMetaTitle, inputMetaDescription, grpSeoPreview, grpSeoChecks, lblSeoScore;
455
+ let lblError, btnSave;
456
+
457
+ // *** CONTENT SERVICE (TEST):
458
+
459
+ const saveContent = function() {
460
+
461
+ const error = validate();
462
+ lblError.text = error;
463
+ if (error) return;
464
+
465
+ btnSave.elem.inert = true;
466
+ if (typeof waiting !== "undefined") waiting.open();
467
+
468
+ saveTimer = setTimeout(function() {
469
+
470
+ // TODO: Save with your service.
471
+ draft.updatedAt = Date.now();
472
+ draft.updatedBy = ContentsPage.getCurrentUserName();
473
+ if (draft.status == "published" && (isNew || content.status != "published")) draft.publishAt = Date.now();
474
+
475
+ if (isNew) {
476
+ draft.id = ContentsPage._nextId++;
477
+ ContentsPage.getContents().push(draft);
478
+ } else {
479
+ Object.assign(content, draft);
480
+ }
481
+
482
+ if (typeof waiting !== "undefined") waiting.close();
483
+
484
+ box.onChange();
485
+ rightView.hide();
486
+ rightView.clean();
487
+
488
+ }, 400);
489
+
490
+ };
491
+
492
+ const deleteContent = function() {
493
+ // TODO: Delete with your service.
494
+ const list = ContentsPage.getContents();
495
+ const index = list.indexOf(content);
496
+ if (index >= 0) list.splice(index, 1);
497
+ box.onChange();
498
+ rightView.hide();
499
+ rightView.clean();
500
+ };
501
+
502
+ const duplicateContent = function() {
503
+ // TODO: Create with your service.
504
+ const copy = JSON.parse(JSON.stringify(content));
505
+ copy.id = ContentsPage._nextId++;
506
+ copy.title = content.title + " (copy)";
507
+ copy.slug = ContentsPage.getUniqueSlug(content.slug + "-copy", content.type);
508
+ copy.status = "draft";
509
+ copy.views = 0;
510
+ copy.updatedAt = Date.now();
511
+ copy.updatedBy = ContentsPage.getCurrentUserName();
512
+ ContentsPage.getContents().push(copy);
513
+ box.onChange();
514
+ ContentEditor({ content: copy, onChange: box.onChange }); // Open the copy
515
+ };
516
+
517
+ // Closes the editor. Asks first if there are unsaved changes.
518
+ const closeEditor = function() {
519
+ if (JSON.stringify(draft) == original) {
520
+ rightView.hide();
521
+ rightView.clean();
522
+ return;
523
+ }
524
+ Theme.confirm({
525
+ titleText: "Unsaved Changes",
526
+ messageText: "Your changes to <b>" + escape(draft.title || "this content") + "</b> will be lost.",
527
+ confirmText: "Discard",
528
+ cancelText: "Keep Editing",
529
+ onAnswer: function(isConfirmed) {
530
+ if (!isConfirmed || !box) return;
531
+ rightView.hide();
532
+ rightView.clean();
533
+ },
534
+ });
535
+ };
536
+
537
+ // *** PRIVATE FUNCTIONS:
538
+
539
+ // Returns an error text, or "".
540
+ const validate = function() {
541
+ if (!draft.title.trim()) return "Title is required.";
542
+ if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(draft.slug)) return "URL: small letters, numbers and \"-\" only.";
543
+ const used = ContentsPage.getContents().some(function(c) { return c !== content && c.type == draft.type && c.slug == draft.slug; });
544
+ if (used) return "URL \"" + draft.slug + "\" is used by another " + TYPES[draft.type].label.toLowerCase() + ".";
545
+ if (draft.status == "scheduled" && !(draft.publishAt > Date.now())) return "Schedule time must be in the future.";
546
+ if (draft.type == "banner" && draft.link && !/^(https?:\/\/|\/)/.test(draft.link)) return "Link must start with \"/\" or \"https://\".";
547
+ return "";
548
+ };
549
+
550
+ const updateUrl = function() {
551
+ lblUrl.text = escape(ContentsPage.getUrl(draft));
552
+ };
553
+
554
+ const updateBodyInfo = function() {
555
+ const words = ContentsPage.countWords(draft.body);
556
+ lblBodyInfo.text = words + " words · " + Math.max(1, Math.round(words / 200)) + " min read";
557
+ };
558
+
559
+ const updateTypeView = function() {
560
+ grpPageOptions.visible = (draft.type == "page") ? 1 : 0;
561
+ grpPostOptions.visible = (draft.type == "post") ? 1 : 0;
562
+ grpBannerOptions.visible = (draft.type == "banner") ? 1 : 0;
563
+ updateUrl();
564
+ updateSeo();
565
+ };
566
+
567
+ const updateScheduleView = function() {
568
+ grpSchedule.visible = (draft.status == "scheduled") ? 1 : 0;
569
+ updateSaveButton();
570
+ };
571
+
572
+ const updateSaveButton = function() {
573
+ const texts = { draft: "Save Draft", published: (isNew || content.status != "published") ? "Publish" : "Update", scheduled: "Schedule", archived: "Archive" };
574
+ btnSave.setText(texts[draft.status]);
575
+ };
576
+
577
+ // Schedule time from the date and time fields
578
+ const updateScheduleTime = function() {
579
+ const date = dateSchedule.getDate();
580
+ const time = timeSchedule.getTime();
581
+ if (!date || !time) { draft.publishAt = 0; return; }
582
+ date.setHours(time.hours, time.minutes, 0, 0);
583
+ draft.publishAt = date.getTime();
584
+ };
585
+
586
+ const updateSeo = function() {
587
+
588
+ // Preview (like a search result)
589
+ const title = draft.metaTitle || draft.title || "Title";
590
+ const description = draft.metaDescription || draft.excerpt || "Add a meta description to show a summary in the search results.";
591
+ grpSeoPreview.lblTitle.text = escape(ContentsPage.cut(title, 60));
592
+ grpSeoPreview.lblUrl.text = escape(ContentsPage.getUrl(draft));
593
+ grpSeoPreview.lblDescription.text = escape(ContentsPage.cut(description, 160));
594
+
595
+ // Checklist
596
+ const checks = ContentsPage.getSeoChecks(draft);
597
+ const okCount = checks.filter(function(check) { return check.ok; }).length;
598
+ lblSeoScore.text = okCount + " / " + checks.length;
599
+ lblSeoScore.textColor = (okCount == checks.length) ? S.ACCENT_COLOR : T.warning;
600
+ grpSeoChecks.lines.forEach(function(line, index) {
601
+ const check = checks[index];
602
+ line.visible = (check) ? 1 : 0;
603
+ if (!check) return;
604
+ line.text = "<span style='color:" + ((check.ok) ? S.ACCENT_COLOR : T.warning) + "'>" + ((check.ok) ? "✓" : "!") + "</span>&nbsp;&nbsp;" + check.text;
605
+ });
606
+
607
+ };
608
+
609
+ const renderImages = function() {
610
+
611
+ const images = ContentsPage.getImages();
612
+
613
+ grpImages.items.forEach(function(item) { item.remove(); });
614
+ grpImages.items = [];
615
+
616
+ const previous = getDefaultContainerBox();
617
+ setDefaultContainerBox(grpImages);
618
+
619
+ // "No image" tile
620
+ const createTile = function(url, title) {
621
+ const tile = Box({ width: 72, height: 72, round: 8, border: 2, color: S.FIELD_COLOR, clickable: 1 });
622
+ tile.position = "relative";
623
+ tile.elem.style.cursor = "pointer";
624
+ tile.elem.title = title;
625
+ tile.borderColor = (draft.image == url) ? S.ACCENT_COLOR : "transparent";
626
+ tile.on("click", function() {
627
+ draft.image = url;
628
+ renderImages();
629
+ updateSeo();
630
+ });
631
+ grpImages.items.push(tile);
632
+ return tile;
633
+ };
634
+
635
+ const tileNone = createTile("", "No image");
636
+ const previousTile = getDefaultContainerBox();
637
+ setDefaultContainerBox(tileNone);
638
+ HGroup({ left: 0, top: 0, width: "100%", height: "100%", align: "center center" });
639
+ Label({ text: "None", fontSize: 12, textColor: Ink(0.5) });
640
+ endGroup();
641
+ setDefaultContainerBox(previousTile);
642
+
643
+ images.forEach(function(image) {
644
+ const tile = createTile(image.url, image.name);
645
+ tile.elem.style.backgroundImage = "url(\"" + image.url + "\")";
646
+ tile.elem.style.backgroundSize = "cover";
647
+ tile.elem.style.backgroundPosition = "center";
648
+ });
649
+
650
+ setDefaultContainerBox(previous);
651
+
652
+ };
653
+
654
+ // *** VIEW HELPERS:
655
+
656
+ const startSection = function(title, rightText) {
657
+ const group = VGroup({ width: "100%", height: "auto", align: "left top", gap: 10, padding: [16, 14], color: S.CARD_COLOR, border: 1, borderColor: S.CARD_BORDER_COLOR, round: 10 });
658
+ HGroup({ width: "100%", height: "auto", align: "left center", gap: 10 });
659
+ that.elem.style.justifyContent = "space-between";
660
+ Label({ text: title.toUpperCase(), fontSize: 11, textColor: Ink(0.45) });
661
+ that.elem.style.letterSpacing = "1px";
662
+ group.lblRight = Label({ text: rightText || "", fontSize: 12, textColor: Ink(0.5) });
663
+ endGroup();
664
+ return group;
665
+ };
666
+
667
+ const createFieldTitle = function(text) {
668
+ Label({ text: text, fontSize: 11, textColor: Ink(0.45) });
669
+ that.elem.style.letterSpacing = "1px";
670
+ return that;
671
+ };
672
+
673
+ // Dark style for InputB
674
+ const createInput = function(params) {
675
+ const input = InputB({
676
+ width: "100%",
677
+ leftPadding: 14,
678
+ rightPadding: 36,
679
+ backgroundColor: S.FIELD_COLOR,
680
+ selectedBackgroundColor: T.surface3,
681
+ lineColor: "transparent",
682
+ selectedLineColor: "transparent",
683
+ backBorderColor: S.CARD_BORDER_COLOR,
684
+ selectedBackBorderColor: S.ACCENT_COLOR,
685
+ backBorderTopRound: 8,
686
+ backBorderBottomRound: 8,
687
+ requiredColor: S.ERROR_COLOR,
688
+ warningColor: S.ERROR_COLOR,
689
+ isRequired: 0,
690
+ ...params,
691
+ });
692
+ // WHY: InputB has fixed text colors for light backgrounds.
693
+ input.title.textColor = Ink(0.45);
694
+ input.title.fontSize = 11;
695
+ input.title.elem.style.letterSpacing = "1px";
696
+ input.input.textColor = Ink(0.9);
697
+ input.input.fontSize = 15;
698
+ input.input.height = 32;
699
+ input.warningBall.borderColor = S.CARD_COLOR;
700
+ return input;
701
+ };
702
+
703
+ const startRow = function() {
704
+ HGroup({ width: "100%", height: "auto", align: "left top", gap: 10 });
705
+ };
706
+
707
+ const flex = function(obj) {
708
+ obj.elem.style.flex = "1 1 0";
709
+ obj.elem.style.minWidth = "0";
710
+ };
711
+
712
+ const darkRadioStyle = {
713
+ mark: { width: 20, height: 20, color: "transparent", borderColor: Ink(0.35) },
714
+ checkedMark: { color: "transparent", borderColor: S.ACCENT_COLOR },
715
+ hoverMark: { borderColor: Ink(0.7) },
716
+ dot: { color: S.ACCENT_COLOR },
717
+ label: { fontSize: 14, textColor: Ink(0.9) },
718
+ };
719
+
720
+ const darkCheckStyle = {
721
+ layout: { padding: [0, 2] },
722
+ mark: { width: 20, height: 20, color: "transparent", borderColor: Ink(0.35) },
723
+ checkedMark: { color: S.PRIMARY_COLOR, borderColor: S.PRIMARY_COLOR },
724
+ hoverMark: { borderColor: Ink(0.7) },
725
+ tick: { color: Ink(1) },
726
+ label: { fontSize: 14, textColor: Ink(0.9) },
727
+ };
728
+
729
+ box.destroy = function() {
730
+ clearTimeout(saveTimer);
731
+ radioList.forEach(function(radio) { radio.remove(); }); // WHY: Radio groups are static lists.
732
+ if (dateSchedule) dateSchedule.remove();
733
+ if (timeSchedule && timeSchedule.remove) timeSchedule.remove();
734
+ box.remove();
735
+ box = null;
736
+ };
737
+
738
+ // *** VIEW:
739
+
740
+ // Left line
741
+ Box(0, 0, 1, "100%", { color: Ink(0.12) });
742
+
743
+ // GROUP: Scrollable content
744
+ startBox(0, 0, "100%", "calc(100% - 76px)", { color: "transparent", scrollY: 1 });
745
+
746
+ VGroup({ width: "100%", height: "auto", align: "left top", gap: 14, padding: 20 });
747
+
748
+ // TITLE
749
+ HGroup({ width: "100%", height: "auto", align: "left center", gap: 10 });
750
+ that.elem.style.justifyContent = "space-between";
751
+
752
+ VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
753
+ Label({ text: (isNew) ? "New " + TYPES[draft.type].label : "Edit " + TYPES[draft.type].label, fontSize: 20, textColor: Ink(0.95) });
754
+ that.elem.style.fontFamily = "opensans-bold";
755
+ if (!isNew) {
756
+ Label({ text: "Last change: " + new Date(content.updatedAt).toLocaleString("en-GB", { dateStyle: "medium", timeStyle: "short" }) + " by " + escape(content.updatedBy) + " · " + content.views.toLocaleString("en-US") + " views", fontSize: 12, textColor: Ink(0.45) });
757
+ }
758
+ endGroup();
759
+
760
+ Icon({ width: 28, height: 28, clickable: 1 });
761
+ that.load("assets/close.png");
762
+ that.elem.style.filter = T.iconFilter;
763
+ that.elem.style.cursor = "pointer";
764
+ that.opacity = 0.6;
765
+ that.on("click", closeEditor);
766
+
767
+ endGroup();
768
+
769
+ // CONTENT
770
+ startSection("Content");
771
+
772
+ inputTitle = createInput({
773
+ titleText: "TITLE",
774
+ inputValue: draft.title, // WHY: Created with the value, so a required warning ball is not left on the screen.
775
+ placeholder: "Ex: How to choose headphones",
776
+ maxChar: 100,
777
+ onEdit: function() {
778
+ draft.title = inputTitle.getInputValue();
779
+ if (!isSlugEdited) {
780
+ draft.slug = ContentsPage.slugify(draft.title);
781
+ inputSlug.setInputValue(draft.slug);
782
+ updateUrl();
783
+ }
784
+ updateSeo();
785
+ },
786
+ });
787
+
788
+ inputSlug = createInput({
789
+ titleText: "URL",
790
+ inputValue: draft.slug,
791
+ placeholder: "how-to-choose-headphones",
792
+ maxChar: 80,
793
+ onEdit: function() {
794
+ const value = inputSlug.getInputValue().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-{2,}/g, "-");
795
+ if (value != inputSlug.getInputValue()) inputSlug.setInputValue(value);
796
+ draft.slug = value;
797
+ isSlugEdited = true;
798
+ updateUrl();
799
+ updateSeo();
800
+ },
801
+ });
802
+
803
+ lblUrl = Label({ text: "", fontSize: 12, textColor: Ink(0.45), width: "100%" });
804
+ that.elem.style.marginTop = "-4px";
805
+ that.elem.style.wordBreak = "break-all";
806
+
807
+ inputExcerpt = createInput({
808
+ titleText: "EXCERPT",
809
+ inputValue: draft.excerpt,
810
+ placeholder: "A short summary for lists (optional)",
811
+ maxChar: 200,
812
+ onEdit: function() { draft.excerpt = inputExcerpt.getInputValue(); updateSeo(); },
813
+ });
814
+
815
+ HGroup({ width: "100%", height: "auto", align: "left center", gap: 10 });
816
+ that.elem.style.justifyContent = "space-between";
817
+ createFieldTitle("TEXT");
818
+ lblBodyInfo = Label({ text: "", fontSize: 12, textColor: Ink(0.45) });
819
+ endGroup();
820
+
821
+ // TEXTAREA: Content text (native, so it has a normal text editing)
822
+ const bodyBox = Box({ width: "100%", height: 220, color: S.FIELD_COLOR, border: 1, borderColor: S.CARD_BORDER_COLOR, round: 8 });
823
+ bodyBox.position = "relative";
824
+ bodyArea = document.createElement("textarea");
825
+ bodyArea.value = draft.body;
826
+ bodyArea.placeholder = "Write the content. A line that starts with \"## \" is a heading.";
827
+ // WHY: basic.css gives "pointer-events: none" to the boxes and "user-select: none" to the page. They are inherited,
828
+ // so the textarea could not be clicked or selected. They are set back for the textarea.
829
+ bodyArea.style.cssText = "position:absolute; left:0; top:0; width:100%; height:100%; box-sizing:border-box; padding:12px 14px; " +
830
+ "background:transparent; border:0; outline:none; resize:none; color:" + Ink(0.9) + "; font-family:inherit; font-size:15px; line-height:1.6; " +
831
+ "pointer-events:auto; user-select:text; -webkit-user-select:text; cursor:text;";
832
+ bodyArea.addEventListener("focus", function() { bodyBox.borderColor = S.ACCENT_COLOR; });
833
+ bodyArea.addEventListener("blur", function() { bodyBox.borderColor = S.CARD_BORDER_COLOR; });
834
+ bodyArea.addEventListener("input", function() {
835
+ draft.body = bodyArea.value;
836
+ updateBodyInfo();
837
+ updateSeo();
838
+ });
839
+ bodyBox.elem.appendChild(bodyArea);
840
+
841
+ // PAGE OPTIONS
842
+ grpPageOptions = VGroup({ width: "100%", height: "auto", align: "left top", gap: 8 });
843
+ CheckBox({
844
+ labelText: "Show in the site menu",
845
+ checked: draft.showInMenu,
846
+ style: darkCheckStyle,
847
+ onChange: function(self) { draft.showInMenu = self.checked; },
848
+ });
849
+ endGroup();
850
+
851
+ // POST OPTIONS
852
+ grpPostOptions = VGroup({ width: "100%", height: "auto", align: "left top", gap: 10 });
853
+
854
+ startRow();
855
+
856
+ VGroup({ width: "auto", height: "auto", align: "left top", gap: 6 });
857
+ that.elem.style.flexShrink = "0";
858
+ createFieldTitle("CATEGORY");
859
+ that.elem.style.marginTop = "4px";
860
+ ContentsPage.createTinySelect(
861
+ ContentsPage.CATEGORIES.map(function(name) { return { id: name, label: name }; }),
862
+ function(id) { draft.category = id; },
863
+ Math.max(0, ContentsPage.CATEGORIES.indexOf(draft.category))
864
+ );
865
+ endGroup();
866
+
867
+ inputTags = createInput({
868
+ titleText: "TAGS",
869
+ inputValue: draft.tags.join(", "),
870
+ placeholder: "audio, guide (comma between tags)",
871
+ maxChar: 120,
872
+ onEdit: function() {
873
+ draft.tags = inputTags.getInputValue().split(",").map(function(tag) { return tag.trim().toLowerCase(); }).filter(Boolean);
874
+ },
875
+ });
876
+ flex(inputTags);
877
+
878
+ endGroup();
879
+
880
+ endGroup();
881
+
882
+ // BANNER OPTIONS
883
+ grpBannerOptions = VGroup({ width: "100%", height: "auto", align: "left top", gap: 10 });
884
+
885
+ startRow();
886
+
887
+ inputLink = createInput({
888
+ titleText: "LINK",
889
+ inputValue: draft.link,
890
+ placeholder: "/summer-sale or https://...",
891
+ maxChar: 200,
892
+ onEdit: function() { draft.link = inputLink.getInputValue().trim(); },
893
+ });
894
+ flex(inputLink);
895
+
896
+ VGroup({ width: "auto", height: "auto", align: "left top", gap: 6 });
897
+ that.elem.style.flexShrink = "0";
898
+ createFieldTitle("PLACEMENT");
899
+ that.elem.style.marginTop = "4px";
900
+ ContentsPage.createTinySelect(
901
+ ContentsPage.PLACEMENTS.map(function(name) { return { id: name, label: name }; }),
902
+ function(id) { draft.placement = id; },
903
+ Math.max(0, ContentsPage.PLACEMENTS.indexOf(draft.placement))
904
+ );
905
+ endGroup();
906
+
907
+ endGroup();
908
+
909
+ endGroup();
910
+
911
+ endGroup();
912
+
913
+ // PUBLISHING
914
+ startSection("Publishing");
915
+
916
+ HGroup({ width: "100%", height: "auto", align: "left center", gap: 18 });
917
+ that.elem.style.flexWrap = "wrap";
918
+
919
+ Object.keys(STATUSES).forEach(function(status) {
920
+ const radio = RadioButton({
921
+ group: "contentStatus",
922
+ value: status,
923
+ checked: (draft.status == status) ? 1 : 0,
924
+ labelText: STATUSES[status].label,
925
+ style: darkRadioStyle,
926
+ onChange: function(self) {
927
+ draft.status = self.value;
928
+ // WHY "in the future": a published item has a past time; the time on the screen must be used
929
+ if (draft.status == "scheduled" && !(draft.publishAt > Date.now())) updateScheduleTime();
930
+ updateScheduleView();
931
+ },
932
+ });
933
+ radioList.push(radio);
934
+ });
935
+
936
+ endGroup();
937
+
938
+ Label({ text: "Draft: only the team can see it. Published: visible on the site. Scheduled: published at the time. Archived: hidden, kept for later.", fontSize: 12, textColor: Ink(0.45), width: "100%" });
939
+
940
+ // Schedule
941
+ grpSchedule = HGroup({ width: "100%", height: "auto", align: "left bottom", gap: 10 });
942
+ that.elem.style.flexWrap = "wrap";
943
+
944
+ const tomorrow = new Date(Date.now() + ContentsPage.DAY);
945
+ const scheduleStart = (draft.publishAt > Date.now()) ? new Date(draft.publishAt) : tomorrow;
946
+
947
+ VGroup({ width: "auto", height: "auto", align: "left top", gap: 6 });
948
+ createFieldTitle("PUBLISH DATE");
949
+ dateSchedule = SelectDate({
950
+ width: 170,
951
+ height: 40,
952
+ date: scheduleStart,
953
+ minDate: new Date(),
954
+ format: "DD MMM YYYY",
955
+ showClearButton: 0,
956
+ style: ContentsPage.DATE_STYLE,
957
+ onChange: function() { updateScheduleTime(); },
958
+ });
959
+ endGroup();
960
+
961
+ VGroup({ width: "auto", height: "auto", align: "left top", gap: 6 });
962
+ createFieldTitle("TIME");
963
+ timeSchedule = SelectTime({
964
+ width: 120,
965
+ height: 40,
966
+ time: (draft.publishAt > Date.now()) ? scheduleStart : "09:00",
967
+ minuteStep: 15,
968
+ showClearButton: 0,
969
+ style: ContentsPage.TIME_STYLE,
970
+ onChange: function() { updateScheduleTime(); },
971
+ });
972
+ endGroup();
973
+
974
+ endGroup();
975
+
976
+ // Author
977
+ HGroup({ width: "100%", height: "auto", align: "left center", gap: 10 });
978
+ that.elem.style.marginTop = "4px";
979
+ createFieldTitle("AUTHOR");
980
+ const authors = ContentsPage.getAuthors();
981
+ if (!authors.includes(draft.author)) authors.push(draft.author);
982
+ ContentsPage.createTinySelect(
983
+ authors.map(function(name) { return { id: name, label: name }; }),
984
+ function(id) { draft.author = id; },
985
+ Math.max(0, authors.indexOf(draft.author))
986
+ );
987
+ endGroup();
988
+
989
+ endGroup();
990
+
991
+ // FEATURED IMAGE
992
+ startSection("Featured image", "From the Media Library");
993
+
994
+ grpImages = HGroup({ width: "100%", height: "auto", align: "left top", gap: 8 });
995
+ that.elem.style.flexWrap = "wrap";
996
+ grpImages.items = [];
997
+ endGroup();
998
+
999
+ endGroup();
1000
+
1001
+ // SEO
1002
+ const seoSection = startSection("SEO", "");
1003
+ lblSeoScore = seoSection.lblRight;
1004
+
1005
+ inputMetaTitle = createInput({
1006
+ titleText: "META TITLE",
1007
+ inputValue: draft.metaTitle,
1008
+ placeholder: "Empty: the title is used",
1009
+ maxChar: 70,
1010
+ onEdit: function() { draft.metaTitle = inputMetaTitle.getInputValue(); updateSeo(); },
1011
+ });
1012
+
1013
+ inputMetaDescription = createInput({
1014
+ titleText: "META DESCRIPTION",
1015
+ inputValue: draft.metaDescription,
1016
+ placeholder: "70-160 letters. Shown in the search results.",
1017
+ maxChar: 170,
1018
+ onEdit: function() { draft.metaDescription = inputMetaDescription.getInputValue(); updateSeo(); },
1019
+ });
1020
+
1021
+ // Search result preview
1022
+ grpSeoPreview = VGroup({ width: "100%", height: "auto", align: "left top", gap: 2, padding: [14, 12], color: "#FFFFFF", round: 8 });
1023
+ grpSeoPreview.lblUrl = Label({ text: "", fontSize: 12, textColor: "#3C4043", width: "100%" });
1024
+ that.elem.style.wordBreak = "break-all";
1025
+ grpSeoPreview.lblTitle = Label({ text: "", fontSize: 18, textColor: "#1A0DAB", width: "100%" });
1026
+ grpSeoPreview.lblDescription = Label({ text: "", fontSize: 13, textColor: "#4D5156", width: "100%" });
1027
+ endGroup();
1028
+
1029
+ // Checklist
1030
+ grpSeoChecks = VGroup({ width: "100%", height: "auto", align: "left top", gap: 4 });
1031
+ grpSeoChecks.lines = [];
1032
+ for (let i = 0; i < 6; i++) {
1033
+ grpSeoChecks.lines.push(Label({ text: "", fontSize: 13, textColor: Ink(0.8), width: "100%" }));
1034
+ }
1035
+ endGroup();
1036
+
1037
+ endGroup();
1038
+
1039
+ endGroup();
1040
+
1041
+ endBox();
1042
+
1043
+ // GROUP: Buttons (bottom)
1044
+ HGroup({ left: 0, bottom: 0, width: "100%", height: 76, align: "left center", gap: 8, padding: [20, 0] });
1045
+ that.elem.style.borderTop = "1px solid " + Ink(0.08);
1046
+
1047
+ if (!isNew) {
1048
+
1049
+ const btnDelete = HoldToConfirmButton({
1050
+ height: 40,
1051
+ labelText: "Hold to Delete",
1052
+ completedText: "DELETED",
1053
+ iconFile: "_basic/comp/hold-to-confirm-button/trash.png",
1054
+ holdingIconFile: "_basic/comp/hold-to-confirm-button/trash-red.png",
1055
+ holdDuration: 1200,
1056
+ resetDelay: 600,
1057
+ style: {
1058
+ layout: { gap: 6, padding: [14, 0] },
1059
+ icon: { width: 20, height: 20 },
1060
+ label: { fontSize: 14, textColor: Ink(0.9) },
1061
+ holdingLabel: { fontSize: 14, textColor: "#B03A2E" },
1062
+ completedLabel: { fontSize: 14, textColor: T.primaryActive },
1063
+ box: { color: S.FIELD_COLOR, border: 1, borderColor: S.CARD_BORDER_COLOR, round: 8 },
1064
+ holdingBox: { color: "#FFD1CB", borderColor: S.ERROR_COLOR, round: 8 },
1065
+ completedBox: { color: "#DFEFE6", borderColor: S.ACCENT_COLOR, round: 8 },
1066
+ },
1067
+ onConfirm: deleteContent,
1068
+ });
1069
+ btnDelete.icon.elem.style.filter = T.iconFilter; // WHY: Only the normal icon is on a dark background.
1070
+
1071
+ ContentsPage.createButton("Duplicate", "", duplicateContent);
1072
+
1073
+ }
1074
+
1075
+ ContentsPage.createButton("Preview", "", function() { ContentsPage.openPreview(draft); });
1076
+
1077
+ lblError = Label({ text: "", fontSize: 13, textColor: S.ERROR_COLOR, textAlign: "right" });
1078
+ lblError.elem.style.flex = "1 1 auto";
1079
+ lblError.elem.style.minWidth = "0";
1080
+
1081
+ btnSave = ContentsPage.createButton("Save", "", saveContent, { primary: 1 });
1082
+
1083
+ endGroup();
1084
+
1085
+ // *** INIT CODE:
1086
+
1087
+ // WHY: Hidden after they are created. Objects created in a hidden (display: none) group are not flex items.
1088
+ updateTypeView();
1089
+ updateScheduleView();
1090
+ updateBodyInfo();
1091
+ updateUrl();
1092
+ renderImages();
1093
+ updateSeo();
1094
+
1095
+ rightView.clean();
1096
+ rightView.setKey(ContentEditor.KEY);
1097
+ rightView.setWidth(640);
1098
+ rightView.add(box);
1099
+ rightView.show();
1100
+ rightView.destroyPage = box.destroy;
1101
+
1102
+ if (isNew) inputTitle.input.inputElement.focus();
1103
+
1104
+ return endObject(box);
1105
+
1106
+ };
1107
+
1108
+ ContentEditor.KEY = "ContentEditor";
1109
+
1110
+ // *** STATIC: STYLE AND HELPERS
1111
+
1112
+ ContentsPage.DAY = 24 * 60 * 60 * 1000;
1113
+ ContentsPage.SITE_URL = "https://mysite.com";
1114
+
1115
+ ContentsPage.STYLE = {
1116
+ CARD_COLOR: T.surface,
1117
+ CARD_BORDER_COLOR: Ink(0.1),
1118
+ FIELD_COLOR: T.surface2,
1119
+ PRIMARY_COLOR: T.primary,
1120
+ ACCENT_COLOR: T.accent,
1121
+ ERROR_COLOR: T.danger,
1122
+ };
1123
+
1124
+ // path: The start of the URL on the site
1125
+ ContentsPage.TYPES = {
1126
+ page: { label: "Page", plural: "Pages", path: "/" },
1127
+ post: { label: "Post", plural: "Posts", path: "/blog/" },
1128
+ banner: { label: "Banner", plural: "Banners", path: "/banners/" },
1129
+ };
1130
+
1131
+ ContentsPage.STATUSES = {
1132
+ published: { label: "Published", color: T.accent },
1133
+ draft: { label: "Draft", color: Theme.readable("#A9A79F") },
1134
+ scheduled: { label: "Scheduled", color: T.info },
1135
+ archived: { label: "Archived", color: "#8A6F5C" },
1136
+ };
1137
+
1138
+ ContentsPage.CATEGORIES = ["News", "Guides", "Campaigns", "Company"];
1139
+ ContentsPage.PLACEMENTS = ["Home (top)", "Home (middle)", "Shop (sidebar)", "Checkout"];
1140
+
1141
+ ContentsPage.CONTEXT_MENU_STYLE = {
1142
+ menu: { color: T.surface, border: 1, borderColor: Ink(0.14), round: 8, padding: 4, shadow: "0px 8px 24px " + Black(0.5) },
1143
+ item: { textColor: Ink(0.85) },
1144
+ itemHover: { textColor: Ink(0.95), color: Ink(0.08) },
1145
+ separator: { color: Ink(0.1) },
1146
+ };
1147
+
1148
+ ContentsPage.DATE_STYLE = {
1149
+ field: { color: T.surface2, border: 1, borderColor: Ink(0.1), round: 8 },
1150
+ fieldHover: { borderColor: Ink(0.3) },
1151
+ fieldFocus: { borderColor: T.accent },
1152
+ fieldText: { fontSize: 14, textColor: Ink(0.9) },
1153
+ placeholder: { textColor: Ink(0.4) },
1154
+ icon: { color: Ink(0.55) },
1155
+ panel: { color: T.surface2, borderColor: Ink(0.12), shadow: "0 8px 24px " + Black(0.5) },
1156
+ title: { textColor: Ink(0.9) },
1157
+ arrow: { color: Ink(0.6), hoverColor: Ink(0.08) },
1158
+ weekDay: { textColor: Ink(0.45) },
1159
+ day: { textColor: Ink(0.85), hoverColor: Ink(0.08) },
1160
+ today: { borderColor: Ink(0.35) },
1161
+ selectedDay: { color: T.primary, textColor: Ink(1) },
1162
+ disabledDay: { textColor: Ink(0.2) },
1163
+ footerButton: { textColor: T.accent },
1164
+ };
1165
+
1166
+ ContentsPage.TIME_STYLE = {
1167
+ field: { color: T.surface2, border: 1, borderColor: Ink(0.1), round: 8 },
1168
+ fieldHover: { borderColor: Ink(0.3) },
1169
+ fieldFocus: { borderColor: T.accent },
1170
+ fieldText: { fontSize: 14, textColor: Ink(0.9) },
1171
+ icon: { color: Ink(0.55) },
1172
+ panel: { color: T.surface2, borderColor: Ink(0.12), shadow: "0 8px 24px " + Black(0.5) },
1173
+ columnTitle: { textColor: Ink(0.45), activeTextColor: Ink(0.9) },
1174
+ cell: { textColor: Ink(0.85), hoverColor: Ink(0.08) },
1175
+ selectedCell: { color: T.primary, textColor: Ink(1) },
1176
+ disabledCell: { textColor: Ink(0.2) },
1177
+ footerButton: { textColor: T.accent },
1178
+ };
1179
+
1180
+ ContentsPage.getStatusByLabel = function(label) {
1181
+ const id = Object.keys(ContentsPage.STATUSES).find(function(key) { return ContentsPage.STATUSES[key].label == label; });
1182
+ return (id) ? ContentsPage.STATUSES[id] : null;
1183
+ };
1184
+
1185
+ ContentsPage.escapeHtml = function(text) {
1186
+ return String(text).replace(/[&<>"']/g, function(c) { return { "&": "&amp;", "<": "&lt;", ">": "&gt;", "\"": "&quot;", "'": "&#39;" }[c]; });
1187
+ };
1188
+
1189
+ // Local time: "2026-09-16 14:05" (sortable text)
1190
+ ContentsPage.formatDateTime = function(time) {
1191
+ const d = new Date(time);
1192
+ const pad = function(n) { return String(n).padStart(2, "0"); };
1193
+ return d.getFullYear() + "-" + pad(d.getMonth() + 1) + "-" + pad(d.getDate()) + " " + pad(d.getHours()) + ":" + pad(d.getMinutes());
1194
+ };
1195
+
1196
+ ContentsPage.cut = function(text, max) {
1197
+ return (text.length > max) ? text.slice(0, max - 1).trim() + "…" : text;
1198
+ };
1199
+
1200
+ // "Çok Güzel Bir Başlık!" -> "cok-guzel-bir-baslik"
1201
+ ContentsPage.slugify = function(text) {
1202
+ const map = { "ç": "c", "ğ": "g", "ı": "i", "ö": "o", "ş": "s", "ü": "u", "â": "a", "î": "i", "û": "u", "ä": "a", "ß": "ss", "é": "e", "è": "e" };
1203
+ return String(text).toLowerCase().replace(/[çğıöşüâîûäßéè]/g, function(c) { return map[c]; })
1204
+ .replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60).replace(/-+$/g, "");
1205
+ };
1206
+
1207
+ ContentsPage.getUniqueSlug = function(slug, type) {
1208
+ let result = slug;
1209
+ for (let n = 2; ContentsPage.getContents().some(function(c) { return c.type == type && c.slug == result; }); n++) result = slug + "-" + n;
1210
+ return result;
1211
+ };
1212
+
1213
+ ContentsPage.getUrl = function(content) {
1214
+ return ContentsPage.SITE_URL + ContentsPage.TYPES[content.type].path + (content.slug || "");
1215
+ };
1216
+
1217
+ ContentsPage.countWords = function(text) {
1218
+ const words = String(text).trim().split(/\s+/).filter(Boolean);
1219
+ return words.length;
1220
+ };
1221
+
1222
+ // [{ ok, text }]
1223
+ ContentsPage.getSeoChecks = function(content) {
1224
+ const title = content.metaTitle || content.title;
1225
+ const description = content.metaDescription;
1226
+ const checks = [
1227
+ { ok: title.length >= 20 && title.length <= 60, text: "Title is 20-60 letters (" + title.length + ")" },
1228
+ { ok: description.length >= 70 && description.length <= 160, text: "Meta description is 70-160 letters (" + description.length + ")" },
1229
+ { ok: content.slug.length > 0 && content.slug.length <= 50, text: "URL is short (" + content.slug.length + " letters)" },
1230
+ ];
1231
+ if (content.type != "banner") checks.push({ ok: !!content.image, text: "Has a featured image" });
1232
+ if (content.type == "post") checks.push({ ok: ContentsPage.countWords(content.body) >= 300, text: "Post has at least 300 words (" + ContentsPage.countWords(content.body) + ")" });
1233
+ return checks;
1234
+ };
1235
+
1236
+ // Images of the Media Library (if it is loaded)
1237
+ ContentsPage.getImages = function() {
1238
+ if (typeof MediaPage === "undefined") return [];
1239
+ return MediaPage.getItems().filter(function(item) { return item.type == "image" && item.url; }).slice(0, 13);
1240
+ };
1241
+
1242
+ // Active panel users (from the User List, if it is loaded)
1243
+ ContentsPage.getAuthors = function() {
1244
+ if (typeof UserListPage !== "undefined") {
1245
+ return UserListPage.load().users.filter(function(user) { return user.status == "active"; }).map(function(user) { return user.name; });
1246
+ }
1247
+ return ["Bugra Ozden", "Deniz Arslan", "Ceren Aktas", "Zeynep Karaca"];
1248
+ };
1249
+
1250
+ ContentsPage.getCurrentUserName = function() {
1251
+ return (typeof UserActionsPage !== "undefined") ? UserActionsPage.getCurrentUser().name : "You";
1252
+ };
1253
+
1254
+ // params: { primary: 1, width }
1255
+ ContentsPage.createButton = function(text, iconFile, onClick, params = {}) {
1256
+ const S = ContentsPage.STYLE;
1257
+ const btn = SmartButton({
1258
+ styleName: "classic",
1259
+ width: params.width || "auto",
1260
+ labelText: text,
1261
+ iconFile: iconFile || "",
1262
+ onClick: onClick,
1263
+ style: {
1264
+ layout: { gap: 8, padding: [14, 8] },
1265
+ icon: { width: 18, height: 18 },
1266
+ label: { fontSize: 14, textColor: Ink(0.92) },
1267
+ box: { color: (params.primary) ? S.PRIMARY_COLOR : S.FIELD_COLOR, border: 1, borderColor: S.CARD_BORDER_COLOR, round: 8 },
1268
+ hover: { color: (params.primary) ? T.primaryHover : T.surface3 },
1269
+ active: { color: (params.primary) ? T.primaryActive : T.surface4 },
1270
+ },
1271
+ });
1272
+ if (btn.icon) btn.icon.elem.style.filter = T.iconFilter; // WHY: Panel icons are black.
1273
+ return btn;
1274
+ };
1275
+
1276
+ // selectedIndex: The first selected item
1277
+ ContentsPage.createTinySelect = function(list, onSelect, selectedIndex = 0) {
1278
+ const S = ContentsPage.STYLE;
1279
+ let isReady = 0; // WHY: TinySelect calls onSelect when it is created.
1280
+ const select = TinySelect({
1281
+ list: list,
1282
+ selectedIndex: selectedIndex,
1283
+ height: 40,
1284
+ fontSize: 14,
1285
+ color: S.FIELD_COLOR,
1286
+ border: 1,
1287
+ borderColor: S.CARD_BORDER_COLOR,
1288
+ round: 8,
1289
+ labelBoldFont: 0,
1290
+ labelTextColor: Ink(0.9),
1291
+ arrowIcon: "_basic/comp/tiny-select/arrow.svg",
1292
+ arrowSize: 18,
1293
+ invertIconColor: T.invertIcon,
1294
+ listFontSize: 14,
1295
+ listTextColor: Ink(0.85),
1296
+ listOverTextColor: S.ACCENT_COLOR,
1297
+ listBackgroundColor: S.FIELD_COLOR,
1298
+ listBorderColor: Ink(0.15),
1299
+ onSelect: function(index, id) {
1300
+ if (isReady) onSelect(id);
1301
+ },
1302
+ });
1303
+ isReady = 1;
1304
+ return select;
1305
+ };
1306
+
1307
+ ContentsPage.getSmartTableStyle = function(libPath) {
1308
+ const S = ContentsPage.STYLE;
1309
+ return {
1310
+ scrollBarParams: {
1311
+ bar_border: 0, bar_round: 3, bar_borderColor: Ink(0.15), bar_width: 4, bar_mouseOverWidth: 4,
1312
+ bar_mouseOverColor: T.scrollBar, bar_opacity: 0.4, bar_mouseOverOpacity: 0.9, bar_padding: 2, bar_color: T.scrollBar,
1313
+ neverHide: 0, showDots: 0,
1314
+ },
1315
+ // WHY: Filtre kutusu ile alt bar aynı renkti, kutu görünmüyordu. Bar kart rengine, kutu ise alan rengine (FIELD_COLOR) alındı.
1316
+ searchInputParams: {
1317
+ width: "50%", height: 34, border: 1, round: 8, color: S.FIELD_COLOR, borderColor: S.CARD_BORDER_COLOR,
1318
+ borderBottomStyle: "1px solid " + S.CARD_BORDER_COLOR,
1319
+ textColor: Ink(0.9), placeholderColor: Ink(0.4), fontSize: 14,
1320
+ placeholderText: "Filter the table",
1321
+ searchIconSize: 15, searchIconOpacity: 0.55, invertIconColor: T.invertIcon,
1322
+ searchIconFile: libPath + "comp/search-input-v2/filter.png",
1323
+ clearIconFile: libPath + "comp/search-input-v2/clear.svg",
1324
+ },
1325
+ // Filtre kutusundaki sütun seçim listesi (ALL) de koyu tema ile açılsın.
1326
+ searchTitleMenuParams: {
1327
+ minWidth: 170,
1328
+ style: {
1329
+ menu: { color: S.FIELD_COLOR, border: 1, borderColor: Ink(0.12), round: 8, padding: 4, shadow: "0 8px 24px " + Black(0.5) },
1330
+ item: { height: 30, fontSize: 13, textColor: Ink(0.75), color: "transparent", round: 6, padding: 10, gap: 10 },
1331
+ itemHover: { textColor: "white", color: Ink(0.08) },
1332
+ disabled: { textColor: Ink(0.3), opacity: 0.4 },
1333
+ icon: { width: 14, height: 14 },
1334
+ separator: { color: Ink(0.1), space: 4 },
1335
+ },
1336
+ },
1337
+ style: {
1338
+ width: "100%",
1339
+ height: "100%",
1340
+ round: 8,
1341
+ line1Color: S.CARD_COLOR,
1342
+ line2Color: T.tableRow2,
1343
+ highlightItemCellColor: T.tableHighlight,
1344
+ highlightTitleCellColor: Ink(0.08),
1345
+ verticalScrollWidth: 20,
1346
+ verticalScrollMargin: 2,
1347
+ btnScrollDownIconFile: libPath + "comp/smart-table/down.png",
1348
+ btnScrollUpIconFile: libPath + "comp/smart-table/up.png",
1349
+ btnScrollCenterIconFile: libPath + "comp/smart-table/scroll.png",
1350
+ sortIconFile: libPath + "comp/smart-table/sort.png",
1351
+ // WHY: Varsayılan tik ikonu koyu renkli; koyu menüde görünmüyordu.
1352
+ searchTitleCheckIconFile: "data:image/svg+xml," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="' + S.ACCENT_COLOR + '" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5 10 17.5 19 7"/></svg>'),
1353
+ loadingIconFile: libPath + "comp/smart-table/clock.png",
1354
+ invertIconColor: T.invertIcon,
1355
+ box: { color: S.CARD_COLOR },
1356
+ boxBorder: { border: 1, borderColor: S.CARD_BORDER_COLOR },
1357
+ boxTitleLine: { color: S.FIELD_COLOR },
1358
+ boxTitleCell: { padding: [10, 0], borderRight: "1px solid " + Ink(0.06), borderBottom: "1px solid " + Ink(0.12) },
1359
+ lblTitleCell: { fontSize: 13, fontFamily: "opensans", textColor: Ink(0.6) },
1360
+ boxItemCell: { borderBottom: "1px solid " + Ink(0.05), borderRight: "1px solid " + Ink(0.03), padding: [10, 0] },
1361
+ lblItemCell: { fontSize: 14, textColor: Ink(0.75), fontFamily: "opensans" },
1362
+ boxInfoLine: { color: S.CARD_COLOR, borderTop: "1px solid " + Ink(0.08) },
1363
+ lblBoxInfoLine: { fontSize: 13, textColor: Ink(0.55) },
1364
+ lblNoDataFound: { color: T.surface3, textColor: Ink(0.6), padding: [8, 2], fontSize: 13, round: 8, border: 1, borderColor: Ink(0.15) },
1365
+ // Filtre kutusunun içindeki sütun etiketi: Kutunun içinde durduğu için daha hafif bir chip.
1366
+ lblSearchTitle: { color: Ink(0.08), textColor: Ink(0.6), padding: [8, 1], fontSize: 12, round: 6, border: 1, borderColor: Ink(0.14) },
1367
+ btnScrollCenter: { color: T.surface3, round: 100, borderColor: Ink(0.2), border: 1 },
1368
+ btnScrollUp: { color: T.surface4, round: 100, border: 1, borderColor: Ink(0.3) },
1369
+ btnScrollDown: { color: T.surface4, round: 100, border: 1, borderColor: Ink(0.3) },
1370
+ boxSort: { color: S.PRIMARY_COLOR },
1371
+ },
1372
+ };
1373
+ };
1374
+
1375
+ // Opens the content in a new window, like it is on the site.
1376
+ ContentsPage.openPreview = function(content) {
1377
+
1378
+ const escape = ContentsPage.escapeHtml;
1379
+
1380
+ // "## " lines are headings, empty lines split the paragraphs.
1381
+ const bodyHtml = String(content.body).split(/\n\s*\n/).map(function(block) {
1382
+ block = block.trim();
1383
+ if (!block) return "";
1384
+ if (block.startsWith("## ")) return "<h2>" + escape(block.slice(3)) + "</h2>";
1385
+ return "<p>" + escape(block).replace(/\n/g, "<br>") + "</p>";
1386
+ }).join("");
1387
+
1388
+ const html = "<!DOCTYPE html><html><head><meta charset='UTF-8'><title>" + escape(content.metaTitle || content.title) + "</title>" +
1389
+ "<style>body{font-family:Georgia,serif;color:#222;max-width:720px;margin:40px auto;padding:0 20px;line-height:1.7}" +
1390
+ "img{width:100%;border-radius:10px;margin:16px 0}h1{font-family:system-ui,sans-serif;line-height:1.2}" +
1391
+ ".meta{font-family:system-ui,sans-serif;color:#888;font-size:14px}.bar{font-family:system-ui,sans-serif;background:#FFF4D6;color:#7A5A00;padding:8px 12px;border-radius:6px;font-size:13px}</style></head><body>" +
1392
+ "<div class='bar'>Preview · " + escape(ContentsPage.STATUSES[content.status].label) + " · " + escape(ContentsPage.getUrl(content)) + "</div>" +
1393
+ "<h1>" + escape(content.title || "Untitled") + "</h1>" +
1394
+ "<div class='meta'>" + escape(content.author) + ((content.type == "post") ? " · " + escape(content.category) : "") + "</div>" +
1395
+ ((content.image) ? "<img src='" + escape(content.image) + "' alt=''>" : "") +
1396
+ ((content.excerpt) ? "<p><i>" + escape(content.excerpt) + "</i></p>" : "") +
1397
+ bodyHtml + "</body></html>";
1398
+
1399
+ const win = window.open("", "_blank");
1400
+ if (!win) return; // Pop-up blocked
1401
+ win.document.write(html);
1402
+ win.document.close();
1403
+
1404
+ };
1405
+
1406
+ // *** STATIC: CONTENT DATA (TEST)
1407
+
1408
+ ContentsPage._nextId = 1;
1409
+ ContentsPage._contents = null;
1410
+
1411
+ ContentsPage.createEmptyContent = function(type) {
1412
+ return {
1413
+ id: 0,
1414
+ type: type,
1415
+ title: "",
1416
+ slug: "",
1417
+ excerpt: "",
1418
+ body: "",
1419
+ status: "draft",
1420
+ publishAt: 0,
1421
+ author: ContentsPage.getCurrentUserName(),
1422
+ image: "",
1423
+ metaTitle: "",
1424
+ metaDescription: "",
1425
+ showInMenu: 0, // Page
1426
+ category: ContentsPage.CATEGORIES[0], // Post
1427
+ tags: [], // Post
1428
+ link: "", // Banner
1429
+ placement: ContentsPage.PLACEMENTS[0], // Banner
1430
+ views: 0,
1431
+ updatedAt: Date.now(),
1432
+ updatedBy: ContentsPage.getCurrentUserName(),
1433
+ };
1434
+ };
1435
+
1436
+ // Scheduled contents with a past time become published.
1437
+ // TODO: Do this on your server (a scheduled job), not in the panel.
1438
+ ContentsPage.publishDueContents = function() {
1439
+ const now = Date.now();
1440
+ ContentsPage.getContents().forEach(function(content) {
1441
+ if (content.status == "scheduled" && content.publishAt <= now) content.status = "published";
1442
+ });
1443
+ };
1444
+
1445
+ // Contents of the site. Created one time and kept while the panel is open.
1446
+ // TODO: Load the contents from your service.
1447
+ ContentsPage.getContents = function() {
1448
+
1449
+ if (ContentsPage._contents) return ContentsPage._contents;
1450
+
1451
+ // Random numbers with a seed: the same test data every time. (mulberry32)
1452
+ let seed = 52017;
1453
+ const rnd = function() {
1454
+ seed = (seed + 0x6D2B79F5) | 0;
1455
+ let t = seed;
1456
+ t = Math.imul(t ^ (t >>> 15), t | 1);
1457
+ t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
1458
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
1459
+ };
1460
+ const pick = function(list) { return list[Math.floor(rnd() * list.length)]; };
1461
+
1462
+ const DAY = ContentsPage.DAY;
1463
+ const now = Date.now();
1464
+ const AUTHORS = ["Deniz Arslan", "Ceren Aktas", "Zeynep Karaca", "Bugra Ozden", "Selin Koc"];
1465
+ const images = ContentsPage.getImages().map(function(image) { return image.url; });
1466
+
1467
+ const PARAGRAPH = "Choosing the right product is easier when you know what matters for you. In this text we explain the main points, " +
1468
+ "compare the popular options and share a few tips from our team. Read the details below and ask us if you have a question.";
1469
+
1470
+ const makeBody = function(paragraphCount, headings) {
1471
+ const parts = [];
1472
+ for (let i = 0; i < paragraphCount; i++) {
1473
+ if (headings && i % 3 == 0) parts.push("## " + pick(["What to look for", "Our tips", "Compare the options", "Price and quality", "Final words"]));
1474
+ parts.push(PARAGRAPH);
1475
+ }
1476
+ return parts.join("\n\n");
1477
+ };
1478
+
1479
+ // [type, title, status, days ago (or days later for scheduled), paragraphs]
1480
+ const DATA = [
1481
+ ["page", "About us", "published", 320, 4],
1482
+ ["page", "Contact", "published", 300, 1],
1483
+ ["page", "Shipping policy", "published", 210, 5],
1484
+ ["page", "Returns and refunds", "published", 205, 5],
1485
+ ["page", "Privacy policy", "published", 190, 8],
1486
+ ["page", "Terms of service", "published", 190, 9],
1487
+ ["page", "Careers", "draft", 12, 3],
1488
+ ["page", "Frequently asked questions", "published", 60, 7],
1489
+ ["page", "Store locations", "archived", 400, 2],
1490
+ ["post", "How to choose headphones", "published", 2, 22],
1491
+ ["post", "Summer sale: up to 40% off", "published", 18, 6],
1492
+ ["post", "5 tips for running in the heat", "published", 25, 18],
1493
+ ["post", "Smart watch buying guide 2026", "published", 40, 26],
1494
+ ["post", "Meet our new warehouse", "published", 55, 9],
1495
+ ["post", "How we pack your orders", "published", 70, 12],
1496
+ ["post", "Coffee mugs that keep it warm", "draft", 3, 8],
1497
+ ["post", "Back to school checklist", "scheduled", 4, 20],
1498
+ ["post", "Black Friday is coming", "scheduled", 40, 5],
1499
+ ["post", "Why we use recycled boxes", "published", 95, 14],
1500
+ ["post", "Desk setup ideas for small rooms", "published", 110, 24],
1501
+ ["post", "Our 2025 year in review", "archived", 260, 16],
1502
+ ["post", "New colors for the backpack", "published", 8, 7],
1503
+ ["post", "Care guide for running shoes", "draft", 1, 4],
1504
+ ["post", "Gift ideas under $50", "published", 130, 19],
1505
+ ["post", "How to clean your headphones", "published", 150, 11],
1506
+ ["post", "Behind the scenes: product photos", "draft", 6, 10],
1507
+ ["banner", "Summer sale hero", "published", 18, 1],
1508
+ ["banner", "Free shipping over $100", "published", 90, 1],
1509
+ ["banner", "Back to school", "scheduled", 4, 1],
1510
+ ["banner", "New smart watch", "published", 38, 1],
1511
+ ["banner", "Spring collection", "archived", 150, 1],
1512
+ ["banner", "Black Friday countdown", "draft", 2, 1],
1513
+ ];
1514
+
1515
+ const list = DATA.map(function(item) {
1516
+
1517
+ const type = item[0];
1518
+ const status = item[2];
1519
+ const isScheduled = (status == "scheduled");
1520
+ const time = (isScheduled) ? now + item[3] * DAY + Math.round(rnd() * 8) * 3600000 : now - item[3] * DAY - Math.round(rnd() * 20) * 3600000;
1521
+ const body = (type == "banner") ? pick(["Shop now", "Up to 40% off. This week only.", "Order today, get it tomorrow."]) : makeBody(item[4], type == "post");
1522
+ const hasSeo = rnd() < 0.7;
1523
+
1524
+ const content = ContentsPage.createEmptyContent(type);
1525
+ Object.assign(content, {
1526
+ id: ContentsPage._nextId++,
1527
+ title: item[1],
1528
+ slug: ContentsPage.slugify(item[1]),
1529
+ excerpt: (type == "post") ? "A short summary of \"" + item[1] + "\" for the blog list." : "",
1530
+ body: body,
1531
+ status: status,
1532
+ publishAt: (status == "draft") ? 0 : time,
1533
+ author: pick(AUTHORS),
1534
+ image: (images.length && (type != "page" || rnd() < 0.3) && rnd() < 0.85) ? pick(images) : "",
1535
+ metaTitle: (hasSeo) ? item[1] + " | My Store" : "",
1536
+ metaDescription: (hasSeo) ? "Read \"" + item[1] + "\" on the My Store blog: tips, details and answers to the common questions of our customers." : "",
1537
+ showInMenu: (type == "page" && rnd() < 0.6) ? 1 : 0,
1538
+ category: (type == "post") ? pick(ContentsPage.CATEGORIES) : ContentsPage.CATEGORIES[0],
1539
+ tags: (type == "post") ? [pick(["audio", "fitness", "guide", "sale", "home", "news"]), pick(["tips", "2026", "gift", "office"])] : [],
1540
+ link: (type == "banner") ? pick(["/summer-sale", "/shop", "/blog/smart-watch-buying-guide-2026", "https://mysite.com/black-friday"]) : "",
1541
+ placement: (type == "banner") ? pick(ContentsPage.PLACEMENTS) : ContentsPage.PLACEMENTS[0],
1542
+ views: (status == "published" || status == "archived") ? Math.round((type == "post" ? 4000 : 9000) * rnd() * Math.min(1, item[3] / 60) + 30) : 0,
1543
+ updatedAt: (isScheduled) ? now - Math.round(rnd() * 3) * DAY : time + Math.round(rnd() * 3) * DAY * ((status == "draft") ? 0 : 1),
1544
+ updatedBy: pick(AUTHORS),
1545
+ });
1546
+ if (content.updatedAt > now) content.updatedAt = now - 3600000;
1547
+
1548
+ return content;
1549
+
1550
+ });
1551
+
1552
+ ContentsPage._contents = list;
1553
+ return list;
1554
+
1555
+ };