create-basicjs 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-basicjs",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Create a project with basic.js and the JS-Component Kit, ready to build with AI tools.",
5
5
  "bin": {
6
6
  "create-basicjs": "bin/create-basicjs.js"
@@ -79,6 +79,6 @@ window.checkViews = {
79
79
  };
80
80
  ```
81
81
 
82
- It checks every page, also the ones in folders. A page shown only inside another page can say `<meta name="basic-check" content="skip">`.
82
+ It checks every page, also the ones in folders. A page that can not be checked alone can say `<meta name="basic-check" content="skip">`.
83
83
 
84
84
  The tool needs Chrome or Edge. When it can not run, run `node --check` on the files you changed, and tell the user that the page was not opened.
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -10,8 +10,8 @@
10
10
  // An app with more than one view tells it how to open them (the name of the file is the name of the view):
11
11
  // window.checkViews = { orders: function () { App.showPage("orders"); }, settings: function () { App.showPage("settings"); } };
12
12
  //
13
- // Every page is checked, also the ones in folders. A page shown only inside another one (in a frame as high as its
14
- // content) does not work alone: it says so, and the report counts it as skipped:
13
+ // Every page is checked, also the ones in folders. A page that can not be checked alone says so, and the report counts
14
+ // it as skipped:
15
15
  // <meta name="basic-check" content="skip">
16
16
  //
17
17
  // Exit code: 0 no problem, 1 problems found, 2 could not run.
@@ -1,7 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta name="basic-check" content="skip">
5
4
 
6
5
  <title>Empty Module (Main)</title>
7
6
 
@@ -1,7 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta name="basic-check" content="skip">
5
4
 
6
5
  <title>Greenhouse</title>
7
6
 
@@ -599,9 +598,11 @@
599
598
  that.elem.style.flexWrap = "wrap";
600
599
 
601
600
  HGroup({ width: "auto", height: "auto", align: "left center", gap: 20 });
601
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
602
602
  that.elem.style.flexWrap = "wrap";
603
603
 
604
604
  VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
605
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
605
606
  Label({ text: "Greenhouse", fontSize: 26, textColor: Ink(0.95) });
606
607
  that.elem.style.fontFamily = "opensans-bold";
607
608
  lblHouse = Label({ text: "", fontSize: 14, textColor: Ink(0.5) });
@@ -624,15 +625,18 @@
624
625
  endGroup();
625
626
 
626
627
  HGroup({ width: "auto", height: "auto", align: "right center", gap: 16 });
628
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
627
629
 
628
630
  VGroup({ width: "auto", height: "auto", align: "right center", gap: 0 });
631
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
629
632
  lblClock = Label({ text: "", fontSize: 22, textColor: Ink(0.95) });
630
633
  that.elem.style.fontVariantNumeric = "tabular-nums";
631
- lblWeather = Label({ text: "", fontSize: 12, textColor: Ink(0.5) });
632
- that.elem.style.whiteSpace = "nowrap";
634
+ lblWeather = Label({ text: "", width: "100%", fontSize: 12, textColor: Ink(0.5) });
635
+ that.css = { whiteSpace: "normal", textAlign: "right", width: "max-content", maxWidth: "100%" }; // WHY: On one line when it fits, wraps on a phone
633
636
  endGroup();
634
637
 
635
638
  const btnMore = createButton("More", "top-bar/apps.png", function () { });
639
+ btnMore.css = { flexShrink: "0" }; // WHY: The texts wrap on a phone, not this button
636
640
  moreMenu = ContextMenu({
637
641
  items: [
638
642
  { text: "Test: Heatwave outside", key: "heatwave" },
@@ -1348,6 +1352,7 @@
1348
1352
  });
1349
1353
  Theme.fillTableWidth(grpEventHost.table);
1350
1354
  grpEventHost.table.elem.style.minWidth = "420px";
1355
+ grpEventHost.scrollX = 1; // WHY: a phone is narrower than the table
1351
1356
  setDefaultContainerBox(previous);
1352
1357
  };
1353
1358
 
@@ -1,7 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta name="basic-check" content="skip">
5
4
 
6
5
  <title>Arduino Projects</title>
7
6
 
@@ -378,9 +377,11 @@
378
377
  that.elem.style.flexWrap = "wrap";
379
378
 
380
379
  HGroup({ width: "auto", height: "auto", align: "left center", gap: 20 });
380
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
381
381
  that.elem.style.flexWrap = "wrap";
382
382
 
383
383
  VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
384
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
384
385
  Label({ text: "Arduino Projects", fontSize: 26, textColor: Ink(0.95) });
385
386
  that.elem.style.fontFamily = "opensans-bold";
386
387
  lblSubtitle = Label({ text: "", fontSize: 14, textColor: Ink(0.5) });
@@ -404,8 +405,10 @@
404
405
  endGroup();
405
406
 
406
407
  HGroup({ width: "auto", height: "auto", align: "right center", gap: 16 });
408
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
407
409
 
408
410
  VGroup({ width: "auto", height: "auto", align: "right center", gap: 0 });
411
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
409
412
  lblClock = Label({ text: "", fontSize: 22, textColor: Ink(0.95) });
410
413
  that.elem.style.fontVariantNumeric = "tabular-nums";
411
414
  lblUptime = Label({ text: "", fontSize: 12, textColor: Ink(0.5) });
@@ -413,6 +416,7 @@
413
416
  endGroup();
414
417
 
415
418
  const btnMore = createButton("More", "top-bar/apps.png", function () { });
419
+ btnMore.css = { flexShrink: "0" }; // WHY: The texts wrap on a phone, not this button
416
420
  moreMenu = ContextMenu({
417
421
  items: [
418
422
  { text: "Send a test line to the serial port", key: "serial" },
@@ -1,7 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta name="basic-check" content="skip">
5
4
 
6
5
  <title>Empty Module (Full)</title>
7
6
 
@@ -1,7 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta name="basic-check" content="skip">
5
4
 
6
5
  <title>Empty Module (Right)</title>
7
6
 
@@ -1,7 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta name="basic-check" content="skip">
5
4
 
6
5
  <title>Empty Module (Main, Top Bar)</title>
7
6
 
@@ -1,7 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta name="basic-check" content="skip">
5
4
 
6
5
  <title>Empty Module (Right, Top Bar)</title>
7
6
 
@@ -1,7 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta name="basic-check" content="skip">
5
4
 
6
5
  <title>Energy Hub</title>
7
6
 
@@ -578,9 +577,11 @@
578
577
  that.elem.style.paddingRight = "60px"; // WHY: The close button of the full view is on the right top.
579
578
 
580
579
  HGroup({ width: "auto", height: "auto", align: "left center", gap: 20 });
580
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
581
581
  that.elem.style.flexWrap = "wrap";
582
582
 
583
583
  VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
584
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
584
585
  Label({ text: "Energy Hub", fontSize: 26, textColor: Ink(0.95) });
585
586
  that.elem.style.fontFamily = "opensans-bold";
586
587
  Label({ text: system.site + " · Solar " + system.pv.peakKw + " kWp · Battery " + system.battery.capacity + " kWh · EV charger", fontSize: 14, textColor: Ink(0.5) });
@@ -592,15 +593,18 @@
592
593
  endGroup();
593
594
 
594
595
  HGroup({ width: "auto", height: "auto", align: "right center", gap: 16 });
596
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
595
597
 
596
598
  VGroup({ width: "auto", height: "auto", align: "right center", gap: 0 });
599
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
597
600
  lblClock = Label({ text: "", fontSize: 22, textColor: Ink(0.95) });
598
601
  that.elem.style.fontVariantNumeric = "tabular-nums";
599
- lblWeather = Label({ text: "", fontSize: 12, textColor: Ink(0.5) });
600
- that.elem.style.whiteSpace = "nowrap";
602
+ lblWeather = Label({ text: "", width: "100%", fontSize: 12, textColor: Ink(0.5) });
603
+ that.css = { whiteSpace: "normal", textAlign: "right", width: "max-content", maxWidth: "100%" }; // WHY: On one line when it fits, wraps on a phone
601
604
  endGroup();
602
605
 
603
606
  const btnMore = createButton("More", "top-bar/apps.png", function () { });
607
+ btnMore.css = { flexShrink: "0" }; // WHY: The texts wrap on a phone, not this button
604
608
 
605
609
  moreMenu = ContextMenu({
606
610
  items: [
@@ -1,7 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta name="basic-check" content="skip">
5
4
 
6
5
  <title>3D Printers</title>
7
6
 
@@ -1,7 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta name="basic-check" content="skip">
5
4
 
6
5
  <title>Cold Rooms</title>
7
6
 
@@ -561,9 +560,11 @@
561
560
 
562
561
  // Title and device select
563
562
  HGroup({ width: "auto", height: "auto", align: "left center", gap: 20 });
563
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
564
564
  that.elem.style.flexWrap = "wrap";
565
565
 
566
566
  VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
567
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
567
568
 
568
569
  Label({
569
570
  text: "Cold Rooms",
@@ -617,12 +618,14 @@
617
618
 
618
619
  // Buttons
619
620
  HGroup({ width: "auto", height: "auto", align: "right center", gap: 10 });
621
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
620
622
 
621
623
  createButton("Refresh", "", function () {
622
624
  reconnectDevice(device);
623
625
  });
624
626
 
625
627
  btnMore = createButton("More", "top-bar/apps.png", function () { });
628
+ btnMore.css = { flexShrink: "0" }; // WHY: The texts wrap on a phone, not this button
626
629
 
627
630
  // MENU: More actions
628
631
  moreMenu = ContextMenu({
@@ -1,7 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta name="basic-check" content="skip">
5
4
 
6
5
  <title>Elevator Fleet</title>
7
6
 
@@ -620,9 +619,11 @@
620
619
  that.elem.style.flexWrap = "wrap";
621
620
 
622
621
  HGroup({ width: "auto", height: "auto", align: "left center", gap: 20 });
622
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
623
623
  that.elem.style.flexWrap = "wrap";
624
624
 
625
625
  VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
626
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
626
627
  Label({ text: "Elevator Fleet", fontSize: 26, textColor: Ink(0.95) });
627
628
  that.elem.style.fontFamily = "opensans-bold";
628
629
  lblBuilding = Label({ text: "", fontSize: 14, textColor: Ink(0.5) });
@@ -656,8 +657,10 @@
656
657
  endGroup();
657
658
 
658
659
  HGroup({ width: "auto", height: "auto", align: "right center", gap: 10 });
660
+ that.css = { maxWidth: "100%", minWidth: "0px", flexShrink: "1" }; // WHY: "auto" grows with its content, out of the screen of a phone
659
661
 
660
662
  const btnMore = createButton("More", "top-bar/apps.png", function () { });
663
+ btnMore.css = { flexShrink: "0" }; // WHY: The texts wrap on a phone, not this button
661
664
 
662
665
  moreMenu = ContextMenu({
663
666
  items: [
@@ -840,12 +843,15 @@
840
843
 
841
844
  VGroup({ width: "100%", height: "auto", align: "left top", gap: 10 });
842
845
  MODES.forEach(function (mode) {
843
- RadioButton({
846
+ const radio = RadioButton({
844
847
  group: "carMode", value: mode.value,
845
848
  labelText: mode.text + "<br><span style='color:" + Ink(0.4) + "; font-size: 12px'>" + mode.desc + "</span>",
846
849
  style: DARK_RADIO_STYLE,
847
850
  onChange: function (self) { onModeChange(self.value); },
848
851
  });
852
+ // WHY: A long description was cut by the card, on a desktop too
853
+ radio.css = { maxWidth: "100%" };
854
+ radio.label.css.whiteSpace = "normal";
849
855
  });
850
856
  endGroup();
851
857
 
@@ -1475,6 +1481,7 @@
1475
1481
  });
1476
1482
  Theme.fillTableWidth(grpEventHost.table);
1477
1483
  grpEventHost.table.elem.style.minWidth = "420px";
1484
+ grpEventHost.scrollX = 1; // WHY: a phone is narrower than the table
1478
1485
  setDefaultContainerBox(previous);
1479
1486
  };
1480
1487