uc-dev 1.0.0-beta.2 → 1.0.0-beta.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.
@@ -1,7 +1,8 @@
1
- import { <?=designer.className?> } from '<?=designerFilePath?>';
2
- export class <?=codefile.className?> extends <?=designer.className?> {
3
- constructor() {
4
- super(arguments);
5
-
1
+ <?php let code = sources.ts_tpt.code; ?>
2
+ import { <?=code.designerClassName?> } from '<?=code.designerFilePath?>';
3
+ export class <?=code.className?> extends <?=code.designerClassName?>{
4
+ constructor() {
5
+ super();
6
+
6
7
  }
7
8
  }
@@ -1,4 +1,4 @@
1
- import { HTMLx } from "uc-control/out/lib/WrapperHelper.js";
1
+ import { HTMLx } from "uc-runtime/out/lib/WrapperHelper.js";
2
2
  export default function () {
3
3
  let fcontent =
4
4
  HTMLx.Wrapper([{
@@ -1,5 +1,5 @@
1
- import { HTMLx } from "uc-control/out/lib/WrapperHelper.js";
2
- import ucWinFrame$dynamic from "uc-control/out/renderer/controls/ucWinFrame.uc.html.js";
1
+ import { HTMLx } from "uc-runtime/out/lib/WrapperHelper.js";
2
+ import ucWinFrame$dynamic from "uc-runtime/out/renderer/controls/ucWinFrame.uc.html.js";
3
3
  export default HTMLx.Design({
4
4
  dynamicFilePath: import.meta.url,
5
5
  htmlSource() {
@@ -9,7 +9,7 @@ function pushElement(node){
9
9
  ?><?= pushElement(child) ?>, <?php
10
10
  }
11
11
  }); ?> )<?php }
12
- ?>import { HTMLx } from "uc-control/out/lib/WrapperHelper.js";
12
+ ?>import { HTMLx } from "uc-runtime/out/lib/WrapperHelper.js";
13
13
  export default function () {
14
14
  let fcontent = <?= pushElement(this) ?>;
15
15
  return fcontent;
@@ -0,0 +1,70 @@
1
+ :exclude {
2
+ html,
3
+ body {
4
+ font-family: Arial, Helvetica, sans-serif;
5
+ -webkit-user-select: none;
6
+ user-select: none;
7
+ -moz-user-select: none;
8
+ font-size: small;
9
+ object-fit: contain;
10
+ height: 100%; margin: 0; position: fixed; left: 0px;
11
+ top: 0px; bottom: 0px; right: 0px;
12
+ }
13
+ body * {
14
+ font-size: inherit;
15
+ outline: 0;
16
+ }
17
+ .disabled,
18
+ [disabled="true"] {
19
+ pointer-events: none;
20
+ opacity: 0.4;
21
+ }
22
+ }
23
+
24
+ /*
25
+ QUICK INSTRUCTION FOR BASE CSS
26
+ ------------------------------------------------------------------------
27
+ IMPORTING FILES
28
+ @use/@import "[relativePath]"; // add code of that file at that place
29
+
30
+ ------------------------------------------------------------------------
31
+ SELECT ROOT ELEMENT OF EACH USERCONTROL OF CURRENT PROJECT
32
+ & { ..style code }
33
+ '&' will select all usercontrol's root element `wrapper`;
34
+
35
+ ------------------------------------------------------------------------
36
+ VARIABLES
37
+ $[g]-varName:value; // declaration
38
+ color:$g-varName; // use
39
+ where g stand for 'global'
40
+ i.e
41
+ $g-dockWidth: 150px;
42
+ div.dock{
43
+ width:$g-dockWidth;
44
+ }
45
+ -----------------------------------------------------------------------
46
+ KEEP UNEFFECTED CSS `:exclude`
47
+ :exclude{ .... css code .... }
48
+
49
+ i.e
50
+ :exclude{
51
+ body{
52
+ overflow:hidden;
53
+ }
54
+ }
55
+ -----------------------------------------------------------------------
56
+ DECLARE ANY PROJECT'S STYLE
57
+ root:[projectName or blank for currentproject]{
58
+ .... css cpde ...
59
+ }
60
+ i.e
61
+ root: // affect current projects' eleents
62
+ {
63
+ * { box-sizing:border-box; }
64
+ }
65
+ root:ucControls{ // affect ucControls project's elements
66
+ body{
67
+ overflow:hidden;
68
+ }
69
+ }
70
+ */
@@ -1,5 +1,5 @@
1
1
  import { app, BrowserWindow, screen } from "electron";
2
- import { IpcMainHelper } from "uc-control/core-main.js";
2
+ import { IpcMainHelper } from "uc-runtime/core-main.js";
3
3
  import { dirname, join, resolve } from "path";
4
4
  import { fileURLToPath, pathToFileURL } from "url";
5
5
  const __filename = fileURLToPath(import.meta.url);
@@ -11,12 +11,12 @@ app.on('ready', async () => {
11
11
  win = new BrowserWindow({
12
12
  width: mainScreen.size.width,
13
13
  height: mainScreen.size.height,
14
- titleBarStyle: 'hidden',
14
+ //titleBarStyle: 'hidden',
15
15
  webPreferences: {
16
- nodeIntegration: <?= nodeIntegration ?>,
17
- contextIsolation: <?= contextIsolation ?>,
18
- sandbox: false,
16
+ nodeIntegration: false,
17
+ contextIsolation: true,
19
18
  spellcheck: false,
19
+ sandbox: false,
20
20
  webSecurity: true,
21
21
  preload: join(__dirname, '<?= preloadPath ?>'),
22
22
  },
@@ -1,3 +1,3 @@
1
1
  import { contextBridge, ipcRenderer } from "electron";
2
- import { IpcPreload } from "uc-control/core-main.js";
2
+ import { IpcPreload } from "uc-runtime/core-main.js";
3
3
  IpcPreload.init(contextBridge, ipcRenderer);
@@ -1,5 +1,6 @@
1
- import "uc-control/InitRenderer.js"; /// put this line at the top of the code
2
-
1
+ import { INIT_RENDERER } from "uc-runtime/core.js"; /// put this line at the top of the code
2
+ await INIT_RENDERER();
3
3
  // START YOUR JOURNEY
4
4
 
5
+
5
6
  <?= startUpCode ?>
@@ -1,5 +1,5 @@
1
1
  import { app, BrowserWindow, screen } from "electron";
2
- import { IpcMainHelper } from "uc-control/core-main.js";
2
+ import { IpcMainHelper } from "uc-runtime/core-main.js";
3
3
  import { dirname, join, resolve } from "path";
4
4
  import { fileURLToPath, pathToFileURL } from "url";
5
5
  const __filename = fileURLToPath(import.meta.url);
@@ -1,14 +1,32 @@
1
- import { UcDefaultConfig } from "uc-control/core-main.js";
1
+ import { UcDefaultConfig } from "uc-runtime/core-main.js";
2
2
  <?php
3
3
  const $prf = preference;
4
+ const $cli = cli;
4
5
  const $build = $prf.build;
5
6
  const $dirDec = $prf.dirDeclaration;
6
7
  const $srcDec = $prf.srcDec;
7
8
  const $outDec = $prf.outDec;
8
9
  ?>
9
10
  export default UcDefaultConfig({
10
- useTypeScript:<?= useTypeScript ?>,
11
11
  guid: "<?= guid ?>",
12
+ cli:{
13
+ useElectron: <?= $cli.useElectron ?>,
14
+ useTypeScript: <?= $cli.useTypeScript ?>,
15
+ codeFileExt: "<?= $cli.codeFileExt ?>",
16
+ outputFileExt: "<?= $cli.outputFileExt ?>",
17
+ designerDir: "<?= $cli.designerDir ?>",
18
+ srcDir: "<?= $cli.srcDir ?>",
19
+ outDir: "<?= $cli.outDir ?>",
20
+
21
+ ResourceStorageFile: "<?= $cli.ResourceStorageFile ?>",
22
+ baseCssPath: "<?= $cli.baseCssPath ?>",
23
+ baseHtmlPath:"<?= $cli.baseHtmlPath ?>",
24
+ baseCodePath:"<?= $cli.baseCodePath ?>",
25
+ mainProcessFilePath:"<?= $cli.mainProcessFilePath ?>",
26
+ preloadScriptFilePath:"<?= $cli.preloadScriptFilePath ?>",
27
+ devtools:<?= $cli.devtools ?>,
28
+ removeMenu:<?= $cli.removeMenu ?>,
29
+ },
12
30
  browser: {
13
31
  resolveProjects: [ <?php browser.resolveProjects.forEach(v => {
14
32
  ?> "<?= v ?>", <?php
@@ -17,15 +35,11 @@ export default UcDefaultConfig({
17
35
  <?php for(const [k,v] of Object.entries(browser.importmap)) { ?>
18
36
  <?= JSON.stringify(k) ?>:<?= JSON.stringify(v) ?>
19
37
  <?php } ?>
20
- },
21
- baseCssPath: "<?= browser.baseCssPath ?>",
22
- baseHtmlPath:"<?= browser.baseHtmlPath ?>",
23
- baseCodePath:"<?= browser.baseCodePath ?>",
38
+ },
24
39
  },
25
40
  projectBaseCssPath: "<?= projectBaseCssPath ?>",
26
41
  preference: {
27
42
  build: {
28
- ResourceStorageFile: "<?= $build.ResourceStorageFile ?>",
29
43
  ignorePath: [ <?php $build.ignorePath.forEach(v => {
30
44
  ?> "<?= v ?>", <?php
31
45
  }); ?> ],
@@ -0,0 +1,17 @@
1
+ <wrapper x-caption="Welcome to UC Builder">
2
+ <div class="dashboard">
3
+
4
+ <header class="hero">
5
+ <h1>Welcome 👋</h1>
6
+ <p>Your UC project is ready. Start building something amazing.</p>
7
+ <button class="primary-btn">Create First Control</button>
8
+ </header>
9
+
10
+ <section class="stats" x-name="stateList1">
11
+ </section>
12
+
13
+ <section class="actions" x-name="actionList1">
14
+
15
+ </section>
16
+ </div>
17
+ </wrapper>
@@ -43,27 +43,6 @@
43
43
  gap: 16px;
44
44
  }
45
45
 
46
- .card {
47
- background: white;
48
- padding: 18px;
49
- border-radius: 10px;
50
- box-shadow: 0 2px 6px rgba(0,0,0,0.05);
51
- }
52
-
53
- .card h3 {
54
- margin: 0;
55
- font-size: 14px;
56
- color: #64748b;
57
- }
58
-
59
- .value {
60
- font-size: 28px;
61
- font-weight: bold;
62
- }
63
-
64
- .success {
65
- color: #16a34a;
66
- }
67
46
 
68
47
  /* ACTIONS */
69
48
 
@@ -71,25 +50,4 @@
71
50
  display: grid;
72
51
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
73
52
  gap: 16px;
74
- }
75
-
76
- .action-card {
77
- background: white;
78
- padding: 20px;
79
- border-radius: 10px;
80
- box-shadow: 0 2px 6px rgba(0,0,0,0.05);
81
- }
82
-
83
- .action-card h3 {
84
- margin-top: 0;
85
- }
86
-
87
- .action-card button {
88
- margin-top: 8px;
89
- padding: 8px 14px;
90
- border: none;
91
- border-radius: 6px;
92
- background: #4f46e5;
93
- color: white;
94
- cursor: pointer;
95
- }
53
+ }
@@ -0,0 +1,48 @@
1
+ import { frmDashboard$Designer } from '<?= designerReletivePath ?>';
2
+ import { ResourceManage } from 'uc-runtime/core.js';
3
+ import { tptDashboard } from './tptDashboard.tpt.js';
4
+
5
+ export class frmDashboard extends frmDashboard$Designer {
6
+ async $() {
7
+ const cards = [{
8
+ cardName: 'User Controls',
9
+ value:'111',
10
+ }, {
11
+ cardName: 'Forms',
12
+ value:'80'
13
+ }, {
14
+ cardName: 'Status',
15
+ value:'ready',
16
+ isSuccess:true,
17
+ }];
18
+ const tpt = await tptDashboard.CreateAsync({ parentUc: this });
19
+ cards.forEach(row => {
20
+ this.stateList1.appendChild(tpt.cards.extended.generateNode(row));
21
+ });
22
+
23
+
24
+ const actions = [{
25
+ actionName: 'Create Control',
26
+ description:'Add reusable UI components.',
27
+ buttonText:'New Control'
28
+ }, {
29
+ actionName: 'Edit Layout',
30
+ description:'Design your form visually.',
31
+ buttonText:'Open Designer'
32
+ }, {
33
+ actionName: 'Documentation',
34
+ description:'Learn how UC Builder works.',
35
+ buttonText:'View Docs',
36
+ }];
37
+
38
+ actions.forEach(row => {
39
+ this.actionList1.appendChild(tpt.actionCards.extended.generateNode(row));
40
+ });
41
+
42
+ //const res = ResourceManage.keys();
43
+ //console.log(res);
44
+ //const resName = ;
45
+ //console.log(ResourceManage.getContent("sharepnl:210B865E-13C6-4ED7-A63A-E67CC25F1393"));
46
+
47
+ }
48
+ }
@@ -0,0 +1,17 @@
1
+ <X:TEMPLATE>
2
+ <WRAPPER id="cards">
3
+ <div class="card">
4
+ <h3>
5
+ <?= cardName ?>
6
+ </h3>
7
+ <span class="value <?= isSuccess===true?'success':'' ?>">
8
+ <?= value ?>
9
+ </span>
10
+ </div>
11
+ </WRAPPER>
12
+ <WRAPPER id="actionCards">
13
+ <h3><?= actionName ?></h3>
14
+ <p><?= description ?></p>
15
+ <button><?= buttonText ?></button>
16
+ </WRAPPER>
17
+ </X:TEMPLATE>
@@ -0,0 +1,48 @@
1
+ #cards {
2
+ & {
3
+ background: white;
4
+ padding: 18px;
5
+ border-radius: 10px;
6
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
7
+ }
8
+
9
+ h3 {
10
+ margin: 0;
11
+ font-size: 14px;
12
+ color: #64748b;
13
+ }
14
+
15
+ .value {
16
+ font-size: 28px;
17
+ font-weight: bold;
18
+ }
19
+
20
+ .success {
21
+ color: #16a34a;
22
+ }
23
+ }
24
+
25
+ #actionCards {
26
+
27
+
28
+ & {
29
+ background: white;
30
+ padding: 20px;
31
+ border-radius: 10px;
32
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
33
+ }
34
+
35
+ h3 {
36
+ margin-top: 0;
37
+ }
38
+
39
+ button {
40
+ margin-top: 8px;
41
+ padding: 8px 14px;
42
+ border: none;
43
+ border-radius: 6px;
44
+ background: #4f46e5;
45
+ color: white;
46
+ cursor: pointer;
47
+ }
48
+ }
@@ -31,9 +31,14 @@
31
31
  "noImplicitAny": false,
32
32
  "inlineSources": true,
33
33
  "paths": {
34
- "uc-control/*": [
35
- "./node_modules/uc-control/out/*"
36
- ]
34
+ "uc-runtime/*": [
35
+ "./node_modules/uc-runtime/dist/*"
36
+ ],
37
+ <?php if(isUcControlsInstalled){ ?>
38
+ "uc-controls/*": [
39
+ "./node_modules/uc-controls/out/*"
40
+ ],
41
+ <?php } ?>
37
42
  }
38
43
  },
39
44
  }
package/package.json CHANGED
@@ -13,27 +13,22 @@
13
13
  "designer-build",
14
14
  "electron-tools"
15
15
  ],
16
- "version": "1.0.0-beta.2",
17
- "description": "project builder for uc-control",
16
+ "version": "1.0.0-beta.3",
17
+ "description": "Electron CLI project builder for uc-runtime apps",
18
18
  "license": "ISC",
19
- "author": "",
19
+ "author": "AP",
20
20
  "type": "module",
21
21
  "scripts": {
22
22
  "clean": "rimraf out",
23
- "start": "electron .",
24
23
  "build:es": "node copyRes.mjs && node build-es.js",
25
- "build:dts": "tsc --emitDeclarationOnly",
26
- "build": "tsc && node copyRes.mjs",
27
- "rebuild": "npm run clean && npm run build:es",
28
- "rebuild:start": "npm run rebuild && npm run start"
24
+ "build:dts": "tsc -p tsconfig-declare.json --emitDeclarationOnly",
25
+ "errorcheck": "tsc",
26
+ "rebuild": "npm run errorcheck && npm run clean && npm run build:es"
29
27
  },
30
28
  "devDependencies": {
31
- "@types/node": "^20.11.0",
32
29
  "electron": "^39.1.1",
33
- "rimraf": "^6.0.1",
34
30
  "esbuild": "^0.27.2",
35
- "tsconfig-paths": "^4.2.0",
36
- "typescript": "^5.9.3"
31
+ "rimraf": "^6.0.1"
37
32
  },
38
33
  "dependencies": {
39
34
  "css-select": "^6.0.0",
@@ -1,54 +0,0 @@
1
- <wrapper x-caption="Welcome to UC Builder">
2
- <UCWINFRAME x-name="winFrame1" x-from="uc-control/controls/ucWinFrame.uc.html">
3
- <div class="dashboard">
4
-
5
- <header class="hero">
6
- <h1>Welcome 👋</h1>
7
- <p>Your UC project is ready. Start building something amazing.</p>
8
- <button class="primary-btn">Create First Control</button>
9
- </header>
10
-
11
- <section class="stats">
12
-
13
- <div class="card">
14
- <h3>User Controls</h3>
15
- <span class="value">0</span>
16
- </div>
17
-
18
- <div class="card">
19
- <h3>Forms</h3>
20
- <span class="value">1</span>
21
- </div>
22
-
23
- <div class="card">
24
- <h3>Status</h3>
25
- <span class="value success">Ready</span>
26
- </div>
27
-
28
- </section>
29
-
30
- <section class="actions">
31
-
32
- <div class="action-card">
33
- <h3>Create Control</h3>
34
- <p>Add reusable UI components.</p>
35
- <button>New Control</button>
36
- </div>
37
-
38
- <div class="action-card">
39
- <h3>Edit Layout</h3>
40
- <p>Design your form visually.</p>
41
- <button>Open Designer</button>
42
- </div>
43
-
44
- <div class="action-card">
45
- <h3>Documentation</h3>
46
- <p>Learn how UC Builder works.</p>
47
- <button>View Docs</button>
48
- </div>
49
-
50
- </section>
51
-
52
- </div>
53
- </UCWINFRAME>
54
- </wrapper>