neo.mjs 5.18.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/apps/ServiceWorker.mjs +2 -2
  2. package/buildScripts/buildThemes.mjs +89 -192
  3. package/buildScripts/createClass.mjs +13 -11
  4. package/buildScripts/watchThemes.mjs +41 -83
  5. package/examples/ServiceWorker.mjs +2 -2
  6. package/examples/fieldWithPrefix/MainContainer.mjs +151 -0
  7. package/examples/fieldWithPrefix/app.mjs +6 -0
  8. package/examples/fieldWithPrefix/index.html +11 -0
  9. package/examples/fieldWithPrefix/neo-config.json +7 -0
  10. package/examples/form/field/fileupload/MainContainer.mjs +1 -1
  11. package/examples/form/field/fileupload/server.mjs +2 -2
  12. package/package.json +2 -2
  13. package/resources/scss/src/Global.scss +7 -7
  14. package/resources/scss/src/apps/covid/HeaderContainer.scss +25 -25
  15. package/resources/scss/src/apps/covid/country/Gallery.scss +6 -6
  16. package/resources/scss/src/apps/covid/country/Helix.scss +8 -8
  17. package/resources/scss/src/apps/covid/country/LineChartComponent.scss +2 -2
  18. package/resources/scss/src/apps/docs/ContentTabContainer.scss +3 -3
  19. package/resources/scss/src/apps/docs/HeaderContainer.scss +8 -8
  20. package/resources/scss/src/apps/docs/MainContainer.scss +1 -1
  21. package/resources/scss/src/apps/docs/classdetails/HeaderComponent.scss +1 -1
  22. package/resources/scss/src/apps/docs/classdetails/MembersList.scss +16 -16
  23. package/resources/scss/src/apps/docs/classdetails/TutorialComponent.scss +3 -3
  24. package/resources/scss/src/apps/website/HeaderContainer.scss +9 -9
  25. package/resources/scss/src/apps/website/MainContainer.scss +3 -3
  26. package/resources/scss/src/apps/website/blog/Container.scss +3 -3
  27. package/resources/scss/src/apps/website/blog/List.scss +8 -8
  28. package/resources/scss/src/apps/website/examples/List.scss +7 -7
  29. package/resources/scss/src/apps/website/home/TabContainer.scss +5 -5
  30. package/resources/scss/src/button/Base.scss +101 -101
  31. package/resources/scss/src/button/Split.scss +3 -3
  32. package/resources/scss/src/calendar/view/EditEventContainer.scss +4 -4
  33. package/resources/scss/src/calendar/view/MainContainer.scss +46 -46
  34. package/resources/scss/src/calendar/view/SettingsContainer.scss +3 -3
  35. package/resources/scss/src/calendar/view/YearComponent.scss +13 -13
  36. package/resources/scss/src/calendar/view/calendars/EditContainer.scss +4 -4
  37. package/resources/scss/src/calendar/view/calendars/List.scss +7 -7
  38. package/resources/scss/src/calendar/view/month/Component.scss +15 -13
  39. package/resources/scss/src/calendar/view/week/Component.scss +12 -12
  40. package/resources/scss/src/calendar/view/week/TimeAxisComponent.scss +4 -4
  41. package/resources/scss/src/component/BoxLabel.scss +5 -5
  42. package/resources/scss/src/component/Chip.scss +13 -13
  43. package/resources/scss/src/component/Circle.scss +2 -2
  44. package/resources/scss/src/component/DateSelector.scss +28 -28
  45. package/resources/scss/src/component/Helix.scss +1 -1
  46. package/resources/scss/src/component/Process.scss +17 -17
  47. package/resources/scss/src/component/Progress.scss +2 -2
  48. package/resources/scss/src/component/Splitter.scss +6 -6
  49. package/resources/scss/src/component/StatusBadge.scss +21 -21
  50. package/resources/scss/src/component/Timer.scss +9 -9
  51. package/resources/scss/src/component/Toast.scss +10 -10
  52. package/resources/scss/src/component/Video.scss +5 -5
  53. package/resources/scss/src/container/Accordion.scss +3 -3
  54. package/resources/scss/src/container/AccordionItem.scss +15 -15
  55. package/resources/scss/src/container/Base.scss +3 -3
  56. package/resources/scss/src/container/Panel.scss +4 -4
  57. package/resources/scss/src/container/Viewport.scss +2 -2
  58. package/resources/scss/src/dialog/Base.scss +8 -8
  59. package/resources/scss/src/draggable/list/DragZone.scss +2 -2
  60. package/resources/scss/src/examples/ConfigurationPanel.scss +3 -3
  61. package/resources/scss/src/examples/calendar/basic/MainContainer.scss +2 -2
  62. package/resources/scss/src/examples/fieldWithPrefix/MainContainer.scss +25 -0
  63. package/resources/scss/src/examples/treeSelectionModel/MainContainer.scss +6 -6
  64. package/resources/scss/src/form/Fieldset.scss +4 -4
  65. package/resources/scss/src/form/field/CheckBox.scss +10 -10
  66. package/resources/scss/src/form/field/FileUpload.scss +25 -12
  67. package/resources/scss/src/form/field/Number.scss +5 -5
  68. package/resources/scss/src/form/field/Picker.scss +3 -3
  69. package/resources/scss/src/form/field/Range.scss +5 -5
  70. package/resources/scss/src/form/field/Search.scss +1 -1
  71. package/resources/scss/src/form/field/Select.scss +8 -8
  72. package/resources/scss/src/form/field/Switch.scss +6 -6
  73. package/resources/scss/src/form/field/Text.scss +78 -78
  74. package/resources/scss/src/form/field/TextArea.scss +1 -1
  75. package/resources/scss/src/form/field/trigger/Base.scss +6 -6
  76. package/resources/scss/src/form/field/trigger/Clear.scss +2 -2
  77. package/resources/scss/src/form/field/trigger/CopyToClipboard.scss +3 -3
  78. package/resources/scss/src/form/field/trigger/Time.scss +5 -5
  79. package/resources/scss/src/grid/Container.scss +6 -6
  80. package/resources/scss/src/grid/View.scss +11 -11
  81. package/resources/scss/src/grid/header/Button.scss +5 -5
  82. package/resources/scss/src/grid/header/Toolbar.scss +2 -2
  83. package/resources/scss/src/list/Base.scss +11 -11
  84. package/resources/scss/src/list/Chip.scss +3 -3
  85. package/resources/scss/src/list/Circle.scss +2 -2
  86. package/resources/scss/src/menu/List.scss +21 -21
  87. package/resources/scss/src/menu/Panel.scss +1 -1
  88. package/resources/scss/src/plugin/PrefixField.scss +5 -0
  89. package/resources/scss/src/sitemap/Component.scss +2 -2
  90. package/resources/scss/src/tab/Container.scss +1 -1
  91. package/resources/scss/src/tab/Strip.scss +7 -7
  92. package/resources/scss/src/tab/header/Button.scss +26 -26
  93. package/resources/scss/src/tab/header/Toolbar.scss +18 -18
  94. package/resources/scss/src/table/Container.scss +16 -16
  95. package/resources/scss/src/table/View.scss +11 -11
  96. package/resources/scss/src/table/header/Button.scss +5 -5
  97. package/resources/scss/src/toolbar/Base.scss +20 -20
  98. package/resources/scss/src/toolbar/Breadcrumb.scss +1 -1
  99. package/resources/scss/src/tree/List.scss +5 -5
  100. package/resources/scss/theme-dark/Global.scss +7 -17
  101. package/resources/scss/theme-dark/apps/covid/HeaderContainer.scss +10 -23
  102. package/resources/scss/theme-dark/apps/covid/country/Gallery.scss +7 -17
  103. package/resources/scss/theme-dark/apps/covid/country/Helix.scss +8 -19
  104. package/resources/scss/theme-dark/apps/covid/country/LineChartComponent.scss +3 -9
  105. package/resources/scss/theme-dark/apps/docs/ContentTabContainer.scss +4 -11
  106. package/resources/scss/theme-dark/apps/docs/HeaderContainer.scss +10 -23
  107. package/resources/scss/theme-dark/apps/docs/MainContainer.scss +3 -9
  108. package/resources/scss/theme-dark/apps/docs/classdetails/HeaderComponent.scss +4 -11
  109. package/resources/scss/theme-dark/apps/docs/classdetails/MembersList.scss +17 -37
  110. package/resources/scss/theme-dark/apps/docs/classdetails/TutorialComponent.scss +4 -11
  111. package/resources/scss/theme-dark/apps/website/HeaderContainer.scss +5 -13
  112. package/resources/scss/theme-dark/apps/website/MainContainer.scss +4 -11
  113. package/resources/scss/theme-dark/apps/website/blog/Container.scss +3 -9
  114. package/resources/scss/theme-dark/apps/website/home/TabContainer.scss +4 -11
  115. package/resources/scss/theme-dark/button/Base.scss +108 -219
  116. package/resources/scss/theme-dark/calendar/view/EditEventContainer.scss +4 -12
  117. package/resources/scss/theme-dark/calendar/view/MainContainer.scss +22 -48
  118. package/resources/scss/theme-dark/calendar/view/SettingsContainer.scss +4 -11
  119. package/resources/scss/theme-dark/calendar/view/YearComponent.scss +10 -23
  120. package/resources/scss/theme-dark/calendar/view/calendars/EditContainer.scss +4 -12
  121. package/resources/scss/theme-dark/calendar/view/calendars/List.scss +2 -8
  122. package/resources/scss/theme-dark/calendar/view/month/Component.scss +9 -22
  123. package/resources/scss/theme-dark/calendar/view/week/Component.scss +12 -28
  124. package/resources/scss/theme-dark/component/BoxLabel.scss +5 -13
  125. package/resources/scss/theme-dark/component/Chip.scss +14 -31
  126. package/resources/scss/theme-dark/component/DateSelector.scss +24 -52
  127. package/resources/scss/theme-dark/component/Process.scss +9 -21
  128. package/resources/scss/theme-dark/component/Progress.scss +3 -9
  129. package/resources/scss/theme-dark/component/Splitter.scss +4 -12
  130. package/resources/scss/theme-dark/component/StatusBadge.scss +19 -41
  131. package/resources/scss/theme-dark/component/Timer.scss +4 -13
  132. package/resources/scss/theme-dark/component/Toast.scss +8 -20
  133. package/resources/scss/theme-dark/component/Video.scss +3 -10
  134. package/resources/scss/theme-dark/container/Accordion.scss +5 -13
  135. package/resources/scss/theme-dark/container/AccordionItem.scss +10 -23
  136. package/resources/scss/theme-dark/container/Base.scss +4 -11
  137. package/resources/scss/theme-dark/container/Panel.scss +5 -13
  138. package/resources/scss/theme-dark/container/Viewport.scss +3 -9
  139. package/resources/scss/theme-dark/dialog/Base.scss +5 -13
  140. package/resources/scss/theme-dark/examples/ConfigurationPanel.scss +3 -9
  141. package/resources/scss/theme-dark/examples/calendar/basic/MainContainer.scss +3 -10
  142. package/resources/scss/theme-dark/form/Fieldset.scss +5 -14
  143. package/resources/scss/theme-dark/form/field/CheckBox.scss +7 -18
  144. package/resources/scss/theme-dark/form/field/FileUpload.scss +11 -26
  145. package/resources/scss/theme-dark/form/field/Picker.scss +5 -13
  146. package/resources/scss/theme-dark/form/field/Range.scss +4 -11
  147. package/resources/scss/theme-dark/form/field/Search.scss +3 -9
  148. package/resources/scss/theme-dark/form/field/Select.scss +8 -20
  149. package/resources/scss/theme-dark/form/field/Switch.scss +6 -16
  150. package/resources/scss/theme-dark/form/field/Text.scss +31 -66
  151. package/resources/scss/theme-dark/form/field/trigger/Base.scss +5 -14
  152. package/resources/scss/theme-dark/form/field/trigger/Time.scss +3 -10
  153. package/resources/scss/theme-dark/grid/Container.scss +6 -16
  154. package/resources/scss/theme-dark/grid/View.scss +12 -28
  155. package/resources/scss/theme-dark/grid/header/Button.scss +5 -14
  156. package/resources/scss/theme-dark/list/Base.scss +11 -26
  157. package/resources/scss/theme-dark/menu/List.scss +20 -44
  158. package/resources/scss/theme-dark/menu/Panel.scss +2 -8
  159. package/resources/scss/theme-dark/tab/Container.scss +3 -9
  160. package/resources/scss/theme-dark/tab/Strip.scss +5 -13
  161. package/resources/scss/theme-dark/tab/header/Button.scss +29 -62
  162. package/resources/scss/theme-dark/table/Container.scss +9 -22
  163. package/resources/scss/theme-dark/table/View.scss +13 -29
  164. package/resources/scss/theme-dark/table/header/Button.scss +6 -16
  165. package/resources/scss/theme-dark/toolbar/Base.scss +4 -11
  166. package/resources/scss/theme-dark/tree/List.scss +4 -11
  167. package/resources/scss/theme-light/Global.scss +7 -17
  168. package/resources/scss/theme-light/apps/covid/HeaderContainer.scss +10 -23
  169. package/resources/scss/theme-light/apps/covid/country/Gallery.scss +7 -17
  170. package/resources/scss/theme-light/apps/covid/country/Helix.scss +8 -19
  171. package/resources/scss/theme-light/apps/covid/country/LineChartComponent.scss +3 -9
  172. package/resources/scss/theme-light/apps/docs/ContentTabContainer.scss +4 -11
  173. package/resources/scss/theme-light/apps/docs/HeaderContainer.scss +10 -23
  174. package/resources/scss/theme-light/apps/docs/MainContainer.scss +3 -9
  175. package/resources/scss/theme-light/apps/docs/classdetails/HeaderComponent.scss +4 -11
  176. package/resources/scss/theme-light/apps/docs/classdetails/MembersList.scss +17 -37
  177. package/resources/scss/theme-light/apps/docs/classdetails/TutorialComponent.scss +4 -11
  178. package/resources/scss/theme-light/apps/website/HeaderContainer.scss +5 -13
  179. package/resources/scss/theme-light/apps/website/MainContainer.scss +4 -11
  180. package/resources/scss/theme-light/apps/website/blog/Container.scss +3 -9
  181. package/resources/scss/theme-light/apps/website/home/TabContainer.scss +4 -11
  182. package/resources/scss/theme-light/button/Base.scss +107 -218
  183. package/resources/scss/theme-light/calendar/view/EditEventContainer.scss +4 -12
  184. package/resources/scss/theme-light/calendar/view/MainContainer.scss +22 -48
  185. package/resources/scss/theme-light/calendar/view/SettingsContainer.scss +3 -11
  186. package/resources/scss/theme-light/calendar/view/YearComponent.scss +10 -23
  187. package/resources/scss/theme-light/calendar/view/calendars/EditContainer.scss +4 -12
  188. package/resources/scss/theme-light/calendar/view/calendars/List.scss +2 -8
  189. package/resources/scss/theme-light/calendar/view/month/Component.scss +10 -23
  190. package/resources/scss/theme-light/calendar/view/week/Component.scss +12 -28
  191. package/resources/scss/theme-light/component/BoxLabel.scss +5 -13
  192. package/resources/scss/theme-light/component/Chip.scss +14 -31
  193. package/resources/scss/theme-light/component/DateSelector.scss +24 -52
  194. package/resources/scss/theme-light/component/Process.scss +9 -21
  195. package/resources/scss/theme-light/component/Progress.scss +3 -9
  196. package/resources/scss/theme-light/component/Splitter.scss +4 -12
  197. package/resources/scss/theme-light/component/StatusBadge.scss +19 -41
  198. package/resources/scss/theme-light/component/Timer.scss +5 -14
  199. package/resources/scss/theme-light/component/Toast.scss +8 -20
  200. package/resources/scss/theme-light/component/Video.scss +3 -10
  201. package/resources/scss/theme-light/container/Accordion.scss +5 -13
  202. package/resources/scss/theme-light/container/AccordionItem.scss +10 -23
  203. package/resources/scss/theme-light/container/Base.scss +4 -11
  204. package/resources/scss/theme-light/container/Panel.scss +5 -13
  205. package/resources/scss/theme-light/container/Viewport.scss +3 -9
  206. package/resources/scss/theme-light/dialog/Base.scss +5 -13
  207. package/resources/scss/theme-light/examples/ConfigurationPanel.scss +3 -9
  208. package/resources/scss/theme-light/examples/calendar/basic/MainContainer.scss +3 -10
  209. package/resources/scss/theme-light/form/Fieldset.scss +5 -14
  210. package/resources/scss/theme-light/form/field/CheckBox.scss +7 -18
  211. package/resources/scss/theme-light/form/field/FileUpload.scss +11 -26
  212. package/resources/scss/theme-light/form/field/Picker.scss +5 -13
  213. package/resources/scss/theme-light/form/field/Range.scss +4 -11
  214. package/resources/scss/theme-light/form/field/Search.scss +3 -9
  215. package/resources/scss/theme-light/form/field/Select.scss +9 -21
  216. package/resources/scss/theme-light/form/field/Switch.scss +6 -16
  217. package/resources/scss/theme-light/form/field/Text.scss +31 -66
  218. package/resources/scss/theme-light/form/field/trigger/Base.scss +5 -14
  219. package/resources/scss/theme-light/form/field/trigger/Time.scss +3 -10
  220. package/resources/scss/theme-light/grid/Container.scss +6 -16
  221. package/resources/scss/theme-light/grid/View.scss +12 -28
  222. package/resources/scss/theme-light/grid/header/Button.scss +5 -14
  223. package/resources/scss/theme-light/list/Base.scss +12 -27
  224. package/resources/scss/theme-light/menu/List.scss +20 -44
  225. package/resources/scss/theme-light/menu/Panel.scss +2 -8
  226. package/resources/scss/theme-light/tab/Container.scss +3 -9
  227. package/resources/scss/theme-light/tab/Strip.scss +5 -13
  228. package/resources/scss/theme-light/tab/header/Button.scss +29 -62
  229. package/resources/scss/theme-light/table/Container.scss +9 -22
  230. package/resources/scss/theme-light/table/View.scss +13 -29
  231. package/resources/scss/theme-light/table/header/Button.scss +6 -16
  232. package/resources/scss/theme-light/toolbar/Base.scss +4 -11
  233. package/resources/scss/theme-light/tree/List.scss +4 -11
  234. package/src/DefaultConfig.mjs +2 -2
  235. package/src/component/Splitter.mjs +0 -1
  236. package/src/draggable/tab/header/toolbar/SortZone.mjs +3 -3
  237. package/src/form/field/FileUpload.mjs +32 -5
  238. package/src/form/field/Text.mjs +1 -1
  239. package/src/main/DomAccess.mjs +2 -2
  240. package/src/main/DomEvents.mjs +50 -12
  241. package/src/manager/DomEvent.mjs +1 -0
  242. package/src/plugin/PrefixField.mjs +304 -0
  243. package/src/tab/header/Toolbar.mjs +8 -8
  244. package/resources/scss/mixins/_all.scss +0 -31
  245. package/resources/scss/theme-dark/_all.scss +0 -15
  246. package/resources/scss/theme-dark/apps/_all.scss +0 -3
  247. package/resources/scss/theme-dark/apps/covid/_all.scss +0 -4
  248. package/resources/scss/theme-dark/apps/docs/ExamplesTreeList.scss +0 -0
  249. package/resources/scss/theme-dark/apps/docs/TutorialsTreeList.scss +0 -0
  250. package/resources/scss/theme-dark/apps/docs/_all.scss +0 -6
  251. package/resources/scss/theme-dark/apps/docs/classdetails/HierarchyTreeList.scss +0 -0
  252. package/resources/scss/theme-dark/apps/docs/classdetails/MainContainer.scss +0 -0
  253. package/resources/scss/theme-dark/apps/docs/classdetails/_all.scss +0 -5
  254. package/resources/scss/theme-dark/apps/website/_all.scss +0 -4
  255. package/resources/scss/theme-dark/button/_all.scss +0 -1
  256. package/resources/scss/theme-dark/calendar/_all.scss +0 -8
  257. package/resources/scss/theme-dark/component/Circle.scss +0 -0
  258. package/resources/scss/theme-dark/component/_all.scss +0 -5
  259. package/resources/scss/theme-dark/container/_all.scss +0 -3
  260. package/resources/scss/theme-dark/dialog/_all.scss +0 -1
  261. package/resources/scss/theme-dark/examples/_all.scss +0 -2
  262. package/resources/scss/theme-dark/form/_all.scss +0 -9
  263. package/resources/scss/theme-dark/form/field/trigger/Clear.scss +0 -0
  264. package/resources/scss/theme-dark/form/field/trigger/_all.scss +0 -3
  265. package/resources/scss/theme-dark/grid/_all.scss +0 -3
  266. package/resources/scss/theme-dark/grid/header/Toolbar.scss +0 -0
  267. package/resources/scss/theme-dark/grid/header/_all.scss +0 -2
  268. package/resources/scss/theme-dark/list/_all.scss +0 -1
  269. package/resources/scss/theme-dark/menu/_all.scss +0 -2
  270. package/resources/scss/theme-dark/tab/_all.scss +0 -3
  271. package/resources/scss/theme-dark/table/_all.scss +0 -3
  272. package/resources/scss/theme-dark/table/header/Toolbar.scss +0 -0
  273. package/resources/scss/theme-dark/table/header/_all.scss +0 -2
  274. package/resources/scss/theme-dark/tree/_all.scss +0 -1
  275. package/resources/scss/theme-light/_all.scss +0 -15
  276. package/resources/scss/theme-light/apps/_all.scss +0 -3
  277. package/resources/scss/theme-light/apps/covid/_all.scss +0 -4
  278. package/resources/scss/theme-light/apps/docs/ExamplesTreeList.scss +0 -0
  279. package/resources/scss/theme-light/apps/docs/TutorialsTreeList.scss +0 -0
  280. package/resources/scss/theme-light/apps/docs/_all.scss +0 -6
  281. package/resources/scss/theme-light/apps/docs/classdetails/HierarchyTreeList.scss +0 -0
  282. package/resources/scss/theme-light/apps/docs/classdetails/MainContainer.scss +0 -0
  283. package/resources/scss/theme-light/apps/docs/classdetails/_all.scss +0 -5
  284. package/resources/scss/theme-light/apps/website/_all.scss +0 -4
  285. package/resources/scss/theme-light/button/_all.scss +0 -1
  286. package/resources/scss/theme-light/calendar/_all.scss +0 -8
  287. package/resources/scss/theme-light/component/Circle.scss +0 -0
  288. package/resources/scss/theme-light/component/_all.scss +0 -5
  289. package/resources/scss/theme-light/container/_all.scss +0 -3
  290. package/resources/scss/theme-light/dialog/_all.scss +0 -1
  291. package/resources/scss/theme-light/examples/_all.scss +0 -2
  292. package/resources/scss/theme-light/form/_all.scss +0 -9
  293. package/resources/scss/theme-light/form/field/trigger/Clear.scss +0 -0
  294. package/resources/scss/theme-light/form/field/trigger/_all.scss +0 -3
  295. package/resources/scss/theme-light/grid/_all.scss +0 -3
  296. package/resources/scss/theme-light/grid/header/Toolbar.scss +0 -0
  297. package/resources/scss/theme-light/grid/header/_all.scss +0 -2
  298. package/resources/scss/theme-light/list/_all.scss +0 -1
  299. package/resources/scss/theme-light/menu/_all.scss +0 -2
  300. package/resources/scss/theme-light/tab/_all.scss +0 -3
  301. package/resources/scss/theme-light/table/_all.scss +0 -3
  302. package/resources/scss/theme-light/table/header/Toolbar.scss +0 -0
  303. package/resources/scss/theme-light/table/header/_all.scss +0 -2
  304. package/resources/scss/theme-light/tree/_all.scss +0 -1
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='5.18.0'
23
+ * @member {String} version='6.0.1'
24
24
  */
25
- version: '5.18.0'
25
+ version: '6.0.1'
26
26
  }
27
27
 
28
28
  /**
@@ -9,23 +9,20 @@ import path from 'path';
9
9
  import postcss from 'postcss';
10
10
  import * as sass from 'sass';
11
11
 
12
- const __dirname = path.resolve(),
13
- cwd = process.cwd(),
14
- requireJson = path => JSON.parse(fs.readFileSync((path))),
15
- packageJson = requireJson(path.resolve(cwd, 'package.json')),
16
- insideNeo = packageJson.name === 'neo.mjs',
17
- neoPath = path.resolve(insideNeo ? './' : './node_modules/neo.mjs/'),
18
- programName = `${packageJson.name} buildThemes`,
19
- program = new Command(),
20
- regexComments = /\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,
21
- regexLineBreak = /(\r\n|\n|\r)/gm,
22
- regexSassImport = /@import[^'"]+?['"](.+?)['"];?/g,
23
- scssPath = 'resources/scss/',
24
- scssFolders = fs.readdirSync(path.resolve(scssPath)),
25
- themeMapFile = 'resources/theme-map.json',
26
- themeMapFileNoVars = 'resources/theme-map-no-vars.json',
27
- themeFolders = [],
28
- questions = [];
12
+ const
13
+ __dirname = path.resolve(),
14
+ cwd = process.cwd(),
15
+ requireJson = path => JSON.parse(fs.readFileSync((path))),
16
+ packageJson = requireJson(path.resolve(cwd, 'package.json')),
17
+ insideNeo = packageJson.name === 'neo.mjs',
18
+ neoPath = path.resolve(insideNeo ? './' : './node_modules/neo.mjs/'),
19
+ programName = `${packageJson.name} buildThemes`,
20
+ program = new Command(),
21
+ scssPath = 'resources/scss/',
22
+ scssFolders = fs.readdirSync(path.resolve(scssPath)),
23
+ themeMapFile = 'resources/theme-map.json',
24
+ themeFolders = [],
25
+ questions = [];
29
26
 
30
27
  scssFolders.forEach(folder => {
31
28
  if (folder.includes('theme')) {
@@ -37,7 +34,6 @@ program
37
34
  .name(programName)
38
35
  .version(packageJson.version)
39
36
  .option('-i, --info', 'print environment debug info')
40
- .option('-c, --cssVars <value>', '"all", "true", "false"')
41
37
  .option('-e, --env <value>', '"all", "dev", "prod"')
42
38
  .option('-f, --framework')
43
39
  .option('-n, --noquestions')
@@ -91,42 +87,29 @@ if (programOpts.info) {
91
87
  default: 'all'
92
88
  });
93
89
  }
94
-
95
- if (!programOpts.cssVars) {
96
- questions.push({
97
- type : 'list',
98
- name : 'cssVars',
99
- message: 'Build using CSS variables?',
100
- choices: ['all', 'yes', 'no'],
101
- default: 'yes'
102
- });
103
- }
104
90
  }
105
91
 
106
92
  inquirer.prompt(questions).then(answers => {
107
- const cssVars = answers.cssVars || programOpts.cssVars || 'all',
108
- env = answers.env || programOpts.env || 'all',
93
+ const env = answers.env || programOpts.env || 'all',
109
94
  themes = answers.themes || programOpts.themes || 'all',
110
95
  insideNeo = programOpts.framework || false,
111
96
  startDate = new Date(),
112
- fileCount = {development: {vars: 0, noVars: 0}, production: {vars: 0, noVars: 0}},
113
- totalFiles = {development: {vars: 0, noVars: 0}, production: {vars: 0, noVars: 0}},
114
- sassThemes = [];
97
+ fileCount = {development: 0, production: 0},
98
+ totalFiles = {development: 0, production: 0};
115
99
 
116
- let themeMap, themeMapNoVars;
100
+ let themeMap;
117
101
 
118
102
  /**
119
103
  * @param {Object} file
120
104
  * @param {String} target
121
- * @param {Boolean} useCssVars
122
105
  */
123
- function addItemToThemeMap(file, target, useCssVars) {
106
+ function addItemToThemeMap(file, target) {
124
107
  let classPath = file.className.split('.'),
125
108
  fileName = classPath.pop(),
126
109
  namespace;
127
110
 
128
111
  classPath = classPath.join('.');
129
- namespace = ns(classPath, true, useCssVars ? themeMap : themeMapNoVars);
112
+ namespace = ns(classPath, true, themeMap);
130
113
 
131
114
  if (!namespace[fileName]) {
132
115
  namespace[fileName] = [target];
@@ -142,23 +125,13 @@ if (programOpts.info) {
142
125
  * @param {String} mode development or production
143
126
  */
144
127
  function buildEnv(p, mode) {
145
- if (cssVars !== 'no') {
146
- parseScssFiles(getAllScssFiles(path.join(p, 'src')), mode, 'src', true);
128
+ parseScssFiles(getAllScssFiles(path.join(p, 'src')), mode, 'src');
147
129
 
148
- themeFolders.forEach(themeFolder => {
149
- if (themes === 'all' || themes === themeFolder) {
150
- parseScssFiles(getAllScssFiles(path.join(p, themeFolder)), mode, themeFolder, true);
151
- }
152
- });
153
- }
154
-
155
- if (cssVars !== 'yes') {
156
- themeFolders.forEach(themeFolder => {
157
- if (themes === 'all' || themes === themeFolder) {
158
- parseScssFiles(getAllScssFiles(path.join(p, 'src')), mode, themeFolder, false);
159
- }
160
- });
161
- }
130
+ themeFolders.forEach(themeFolder => {
131
+ if (themes === 'all' || themes === themeFolder) {
132
+ parseScssFiles(getAllScssFiles(path.join(p, themeFolder)), mode, themeFolder);
133
+ }
134
+ });
162
135
  }
163
136
 
164
137
  /**
@@ -273,171 +246,95 @@ if (programOpts.info) {
273
246
  * @param {Object[]} files
274
247
  * @param {String} mode development or production
275
248
  * @param {String} target src or a theme
276
- * @param {Boolean} useCssVars
277
249
  */
278
- function parseScssFiles(files, mode, target, useCssVars) {
279
- let data = '',
280
- devMode = mode === 'development',
281
- mixinPath = path.resolve(neoPath, 'resources/scss/mixins/_all.scss'),
282
- suffix = useCssVars ? '' : '-no-vars',
283
- themeBuffer = '',
284
- varsFlag = useCssVars ? 'vars' : 'noVars',
285
- dirName, map, neoThemePath, themePath, workspaceThemePath;
286
-
287
- totalFiles[mode][varsFlag] += files.length;
288
-
289
- if (path.sep === '\\') {
290
- mixinPath = mixinPath.replace(/\\/g, '/');
291
- }
292
-
293
- if (target.includes('theme')) {
294
- themePath = `resources/scss/${target}/_all.scss`;
295
- neoThemePath = path.resolve(neoPath, themePath);
296
-
297
- if (!sassThemes[target]) {
298
- dirName = path.dirname(neoThemePath);
299
-
300
- if (fs.existsSync(dirName)) {
301
- themeBuffer += scssCombine(fs.readFileSync(neoThemePath).toString(), dirName);
302
- }
250
+ function parseScssFiles(files, mode, target) {
251
+ let devMode = mode === 'development',
252
+ map;
303
253
 
304
- if (!insideNeo) {
305
- workspaceThemePath = path.resolve(cwd, themePath);
306
- themeBuffer += scssCombine(fs.readFileSync(workspaceThemePath).toString(), path.dirname(workspaceThemePath));
307
- }
308
-
309
- themeBuffer = themeBuffer.replace(regexComments, '');
310
- themeBuffer = themeBuffer.replace(regexLineBreak, '');
311
-
312
- sassThemes[target] = themeBuffer;
313
- }
314
-
315
- data = [
316
- `@use "sass:map";`,
317
- `@use "sass:math";`,
318
- `$neoMap: ();`,
319
- `$useCssVars: ${useCssVars};`,
320
- `@import "${mixinPath}";`,
321
- `$useCssVars: false;`,
322
- `${sassThemes[target]}`,
323
- `$useCssVars: ${useCssVars};`
324
- ].join('');
325
- } else {
326
- data = [
327
- `@use "sass:map";`,
328
- `@use "sass:math";`,
329
- `$neoMap: ();`,
330
- `$useCssVars: ${useCssVars};`,
331
- `@import "${mixinPath}";`
332
- ].join('');
333
- }
254
+ totalFiles[mode] += files.length;
334
255
 
335
256
  files.forEach(file => {
336
- addItemToThemeMap(file, target, useCssVars);
257
+ addItemToThemeMap(file, target);
337
258
 
338
- let folderPath = path.resolve(cwd, `dist/${mode}/css${suffix}/${target}/${file.relativePath}`),
259
+ let folderPath = path.resolve(cwd, `dist/${mode}/css/${target}/${file.relativePath}`),
339
260
  destPath = path.resolve(folderPath, `${file.name}.css`);
340
261
 
341
- fs.readFile(file.path).then(content => {
342
- let result = sass.renderSync({
343
- data : data + scssCombine(content.toString(), path.join(neoPath, scssPath, target, file.relativePath)),
344
- outFile : destPath,
345
- sourceMap : devMode,
346
- sourceMapEmbed: false
347
- });
348
-
349
- const plugins = [autoprefixer];
262
+ let result = sass.compile(file.path, {
263
+ outFile : destPath,
264
+ sourceMap : devMode,
265
+ sourceMapIncludeSources: true
266
+ });
350
267
 
351
- if (mode === 'production') {
352
- plugins.push(cssnano);
353
- }
268
+ const plugins = [autoprefixer];
354
269
 
355
- map = result.map?.toString();
270
+ if (mode === 'production') {
271
+ plugins.push(cssnano);
272
+ }
356
273
 
357
- if (map) {
358
- // https://github.com/neomjs/neo/issues/1970
359
- map = JSON.parse(map);
360
- let len = file.relativePath.split('/').length,
361
- src = `${target}${file.relativePath}/${file.name}.scss`,
362
- i = 0;
363
-
364
- for (; i < len; i++) {
365
- src = '../' + src;
366
- }
274
+ map = result.sourceMap;
367
275
 
368
- map.sources = [src];
276
+ postcss(plugins).process(result.css, {
277
+ from: file.path,
278
+ to : destPath,
279
+ map : !devMode ? null : {
280
+ inline: false,
281
+ prev : map && JSON.stringify(map)
369
282
  }
283
+ }).then(postcssResult => {
284
+ fs.mkdirpSync(folderPath);
285
+ fileCount[mode]++;
370
286
 
371
- postcss(plugins).process(result.css, {
372
- from: file.path,
373
- to : destPath,
374
- map : !devMode ? null : {
375
- prev: map && JSON.stringify(map)
376
- }
377
- }).then(result => {
378
- fs.mkdirpSync(folderPath);
379
- fileCount[mode][varsFlag]++;
380
-
381
- const processTime = (Math.round((new Date - startDate) * 100) / 100000).toFixed(2);
382
- console.log('Writing file:', (fileCount[mode].vars + fileCount[mode].noVars), chalk.blue(`${processTime}s`), destPath);
383
- fs.writeFileSync(destPath, result.css, () => true);
287
+ let map = postcssResult.map,
288
+ processTime = (Math.round((new Date - startDate) * 100) / 100000).toFixed(2);
384
289
 
385
- if (result.map) {
386
- fs.writeFileSync(result.opts.to + '.map', result.map.toString());
387
- }
290
+ console.log('Writing file:', (fileCount[mode] + fileCount[mode]), chalk.blue(`${processTime}s`), destPath);
388
291
 
389
- if (fileCount[mode][varsFlag] === totalFiles[mode][varsFlag]) {
390
- fs.writeFileSync(
391
- path.resolve(cwd, useCssVars ? themeMapFile : themeMapFileNoVars),
392
- JSON.stringify(useCssVars ? themeMap : themeMapNoVars, null, 0)
393
- );
292
+ fs.writeFileSync(
293
+ destPath,
294
+ map ?
295
+ `${postcssResult.css}\n\n/*# sourceMappingURL=${path.relative(path.dirname(destPath), postcssResult.opts.to + '.map')} */` :
296
+ postcssResult.css,
297
+ () => true
298
+ );
394
299
 
395
- fs.mkdirpSync(path.join(cwd, '/dist/', mode, '/resources'), {
396
- recursive: true
397
- });
300
+ if (map) {
301
+ let mapString = map.toString(),
302
+ jsonMap = JSON.parse(mapString),
303
+ sources = jsonMap.sources;
304
+
305
+ // Somehow files contain both: a relative & an absolute file url
306
+ // We only want to keep the relative ones.
307
+ [...sources].forEach((item, index) => {
308
+ if (!item.startsWith('../')) {
309
+ sources.splice(index, 1);
310
+ }
311
+ });
398
312
 
399
- fs.writeFileSync(
400
- path.join(cwd, '/dist/', mode, useCssVars ? themeMapFile : themeMapFileNoVars),
401
- JSON.stringify(useCssVars ? themeMap : themeMapNoVars, null, 0)
402
- );
403
- }
404
- });
405
- });
406
- });
407
- }
313
+ map = JSON.stringify(jsonMap);
408
314
 
409
- /**
410
- * @param {String} content
411
- * @param {String} baseDir
412
- * @returns {String}
413
- */
414
- function scssCombine (content, baseDir) {
415
- if (regexSassImport.test(content)) {
416
- content = content.replace(regexSassImport, (m, capture) => {
417
- if (!insideNeo && capture.startsWith('../')) {
418
- capture = '../../' + capture;
315
+ fs.writeFileSync(postcssResult.opts.to + '.map', map);
419
316
  }
420
317
 
421
- let parse = path.parse(path.join(baseDir, capture)),
422
- file = path.join(`${parse.dir}/${parse.name}.scss`);
318
+ if (fileCount[mode] === totalFiles[mode]) {
319
+ fs.writeFileSync(
320
+ path.resolve(cwd, themeMapFile),
321
+ JSON.stringify(themeMap, null, 0)
322
+ );
423
323
 
424
- if (!fs.existsSync(file)) {
425
- file = path.resolve(`${parse.dir}/_${parse.name}.scss`);
324
+ fs.mkdirpSync(path.join(cwd, '/dist/', mode, '/resources'), {
325
+ recursive: true
326
+ });
426
327
 
427
- if (!fs.existsSync(file)) {
428
- return '';
429
- }
328
+ fs.writeFileSync(
329
+ path.join(cwd, '/dist/', mode, themeMapFile),
330
+ JSON.stringify(themeMap, null, 0)
331
+ );
430
332
  }
431
-
432
- return scssCombine(fs.readFileSync(file).toString(), path.dirname(file));
433
333
  });
434
- }
435
-
436
- return content;
334
+ });
437
335
  }
438
336
 
439
- if (cssVars !== 'no') {themeMap = getThemeMap(themeMapFile);}
440
- if (cssVars !== 'yes') {themeMapNoVars = getThemeMap(themeMapFileNoVars);}
337
+ themeMap = getThemeMap(themeMapFile);
441
338
 
442
339
  // dist/development
443
340
  if (env === 'all' || env === 'dev') {
@@ -676,20 +676,22 @@ if (programOpts.info) {
676
676
  classContent.push(
677
677
  " }",
678
678
  "}",
679
- "",
680
- `Neo.applyClassConfig(${file});`,
681
679
  ""
682
680
  );
683
681
 
684
- isSingleton && classContent.push(
685
- `let instance = Neo.applyClassConfig(${file});`,
686
- "",
687
- "export default instance;"
688
- );
689
-
690
- !isSingleton && classContent.push(
691
- `export default ${file};`
692
- );
682
+ if (isSingleton) {
683
+ classContent.push(
684
+ `let instance = Neo.applyClassConfig(${file});`,
685
+ "",
686
+ "export default instance;"
687
+ );
688
+ } else {
689
+ classContent.push(
690
+ `Neo.applyClassConfig(${file});`,
691
+ "",
692
+ `export default ${file};`
693
+ );
694
+ }
693
695
 
694
696
  classContent.push(
695
697
  ""
@@ -5,13 +5,12 @@ import path from 'path';
5
5
  import postcss from 'postcss';
6
6
  import * as sass from 'sass';
7
7
 
8
- let cwd = process.cwd(),
9
- requireJson = path => JSON.parse(fs.readFileSync((path))),
10
- packageJson = requireJson(path.resolve(cwd, 'package.json')),
11
- neoPath = packageJson.name === 'neo.mjs' ? './' : './node_modules/neo.mjs/',
12
- mixinPath = path.resolve(neoPath, 'resources/scss/mixins/_all.scss'),
13
- regexSassImport = /@import[^'"]+?['"](.+?)['"];?/g,
14
- scssPath = path.resolve(cwd, 'resources/scss');
8
+ let cwd = process.cwd(),
9
+ requireJson = path => JSON.parse(fs.readFileSync((path))),
10
+ packageJson = requireJson(path.resolve(cwd, 'package.json')),
11
+ neoPath = packageJson.name === 'neo.mjs' ? './' : './node_modules/neo.mjs/',
12
+ mixinPath = path.resolve(neoPath, 'resources/scss/mixins/_all.scss'),
13
+ scssPath = path.resolve(cwd, 'resources/scss');
15
14
 
16
15
  if (path.sep === '\\') {
17
16
  mixinPath = mixinPath.replace(/\\/g, '/');
@@ -35,93 +34,52 @@ function buildFile(filename) {
35
34
  let filePath = path.join(scssPath, filename),
36
35
  destPath = path.join(cwd, 'dist/development/css', filename.replace('.scss', '.css')),
37
36
  startDate = new Date(),
38
- data, map;
37
+ map;
39
38
 
40
- data = [
41
- `@use "sass:map";`,
42
- `@use "sass:math";`,
43
- `$neoMap: ();`,
44
- `$useCssVars: true;`,
45
- `@import "${mixinPath}";`
46
- ].join('');
47
-
48
- fs.readFile(filePath).then(content => {
49
- try {
50
- let result = sass.renderSync({
51
- data : data + scssCombine(content.toString(), path.parse(filePath).dir),
52
- outFile : destPath,
53
- sourceMap : true,
54
- sourceMapEmbed: false
55
- });
56
-
57
- map = result.map?.toString();
58
-
59
- if (map) {
60
- // https://github.com/neomjs/neo/issues/1970
61
- map = JSON.parse(map);
62
-
63
- let filenameSlash = filename;
64
-
65
- if (path.sep === '\\') {
66
- filenameSlash = filenameSlash.replace(/\\/g, '/');
67
- }
68
-
69
- let len = filenameSlash.split('/').length,
70
- src = `/scss/${filenameSlash}`,
71
- i = 0;
39
+ try {
40
+ let result = sass.compile(filePath, {
41
+ outFile : destPath,
42
+ sourceMap : true,
43
+ sourceMapIncludeSources: true
44
+ });
72
45
 
73
- for (; i < len; i++) {
74
- src = '../' + src;
75
- }
46
+ map = result.sourceMap;
76
47
 
77
- map.sources = [src];
48
+ postcss([autoprefixer]).process(result.css, {
49
+ from: filePath,
50
+ to : destPath,
51
+ map : {
52
+ inline: false,
53
+ prev : map && JSON.stringify(map)
78
54
  }
55
+ }).then(postcssResult => {
56
+ map = postcssResult.map;
79
57
 
80
- postcss([autoprefixer]).process(result.css, {
81
- from: filePath,
82
- to : destPath,
83
- map : {
84
- prev: map && JSON.stringify(map)
85
- }
86
- }).then(result => {
87
- fs.writeFileSync(destPath, result.css, () => true);
88
-
89
- if (result.map) {
90
- fs.writeFileSync(result.opts.to + '.map', result.map.toString());
91
- }
58
+ fs.writeFileSync(destPath, postcssResult.css, () => true);
92
59
 
93
- const processTime = (Math.round((new Date - startDate) * 100) / 100000).toFixed(2);
94
- console.log('Updated file:', (chalk.blue(`${processTime}s`)), destPath);
95
- });
96
- } catch(error) {
97
- console.log('SCSS build failed for', chalk.red(filename));
98
- console.log(error);
99
- }
100
- });
101
- }
60
+ if (map) {
61
+ let mapString = map.toString(),
62
+ jsonMap = JSON.parse(mapString),
63
+ sources = jsonMap.sources;
102
64
 
103
- /**
104
- * @param {String} content
105
- * @param {String} baseDir
106
- * @returns {String}
107
- */
108
- function scssCombine (content, baseDir) {
109
- if (regexSassImport.test(content)) {
110
- content = content.replace(regexSassImport, (m, capture) => {
111
- let parse = path.parse(path.resolve(baseDir, capture)),
112
- file = path.resolve(`${parse.dir}/${parse.name}.scss`);
65
+ // Somehow files contain both: a relative & an absolute file url
66
+ // We only want to keep the relative ones.
67
+ [...sources].forEach((item, index) => {
68
+ if (!item.startsWith('../')) {
69
+ sources.splice(index, 1);
70
+ }
71
+ });
113
72
 
114
- if (!fs.existsSync(file)) {
115
- file = path.resolve(`${parse.dir}/_${parse.name}.scss`);
73
+ map = JSON.stringify(jsonMap);
116
74
 
117
- if (!fs.existsSync(file)) {
118
- return '';
119
- }
75
+ fs.writeFileSync(postcssResult.opts.to + '.map', map);
120
76
  }
121
77
 
122
- return scssCombine(fs.readFileSync(file).toString(), path.dirname(file));
78
+ const processTime = (Math.round((new Date - startDate) * 100) / 100000).toFixed(2);
79
+ console.log('Updated file:', (chalk.blue(`${processTime}s`)), destPath);
123
80
  });
81
+ } catch(error) {
82
+ console.log('SCSS build failed for', chalk.red(filename));
83
+ console.log(error);
124
84
  }
125
-
126
- return content;
127
85
  }
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='5.18.0'
23
+ * @member {String} version='6.0.1'
24
24
  */
25
- version: '5.18.0'
25
+ version: '6.0.1'
26
26
  }
27
27
 
28
28
  /**