@aaqu/fromcubes-portal-react 0.1.0-alpha.24 → 0.1.0-alpha.26

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.
@@ -740,7 +740,12 @@
740
740
  required: true,
741
741
  validate: fcValidateName,
742
742
  },
743
- compCode: { value: COMP_STARTER },
743
+ compCode: {
744
+ value: COMP_STARTER,
745
+ validate: function (v) {
746
+ return typeof v === "string" && v.trim().length > 0;
747
+ },
748
+ },
744
749
  },
745
750
  inputs: 0,
746
751
  outputs: 0,
@@ -768,7 +773,8 @@
768
773
  */
769
774
  oneditprepare: function () {
770
775
  const node = this;
771
- const code = node.compCode || COMP_STARTER;
776
+ const code =
777
+ typeof node.compCode === "string" ? node.compCode : COMP_STARTER;
772
778
  console.log("[FC-Monaco] COMP oneditprepare, node.id=" + node.id);
773
779
 
774
780
  if (!window.__fcTwClasses) {
@@ -1035,7 +1041,12 @@
1035
1041
  required: true,
1036
1042
  validate: fcValidateName,
1037
1043
  },
1038
- utilCode: { value: UTIL_STARTER },
1044
+ utilCode: {
1045
+ value: UTIL_STARTER,
1046
+ validate: function (v) {
1047
+ return typeof v === "string" && v.trim().length > 0;
1048
+ },
1049
+ },
1039
1050
  },
1040
1051
  inputs: 0,
1041
1052
  outputs: 0,
@@ -1059,7 +1070,8 @@
1059
1070
  */
1060
1071
  oneditprepare: function () {
1061
1072
  const node = this;
1062
- const code = node.utilCode || UTIL_STARTER;
1073
+ const code =
1074
+ typeof node.utilCode === "string" ? node.utilCode : UTIL_STARTER;
1063
1075
  console.log("[FC-Monaco] UTIL oneditprepare, node.id=" + node.id);
1064
1076
 
1065
1077
  if (!window.__fcTwClasses) {
@@ -1275,27 +1287,27 @@ function useDebounce(value, ms = 300) {
1275
1287
  <label style="width:auto;">
1276
1288
  <input
1277
1289
  type="checkbox"
1278
- id="node-input-showWsStatus"
1290
+ id="node-input-portalAuth"
1279
1291
  style="width:auto;margin:0 8px 0 0;vertical-align:middle;"
1280
1292
  />
1281
- Show WebSocket status indicator
1293
+ Enable Portal Auth headers
1282
1294
  </label>
1283
1295
  <div style="font-size:11px;opacity:.5;margin-top:4px;margin-left:4px;">
1284
- Displays a small <em>fromcubes</em> badge in the bottom-right corner
1285
- showing connection state.
1296
+ Read <code>X-Portal-*</code> headers from reverse proxy.
1286
1297
  </div>
1287
1298
  </div>
1288
1299
  <div class="form-row" style="margin-top:12px;">
1289
1300
  <label style="width:auto;">
1290
1301
  <input
1291
1302
  type="checkbox"
1292
- id="node-input-portalAuth"
1303
+ id="node-input-showWsStatus"
1293
1304
  style="width:auto;margin:0 8px 0 0;vertical-align:middle;"
1294
1305
  />
1295
- Enable Portal Auth headers
1306
+ Show WebSocket status indicator
1296
1307
  </label>
1297
1308
  <div style="font-size:11px;opacity:.5;margin-top:4px;margin-left:4px;">
1298
- Read <code>X-Portal-*</code> headers from reverse proxy.
1309
+ Displays a small <em>fromcubes</em> badge in the bottom-right corner
1310
+ showing connection state.
1299
1311
  </div>
1300
1312
  </div>
1301
1313
  </div>
@@ -1305,7 +1317,8 @@ function useDebounce(value, ms = 300) {
1305
1317
  <div class="form-row">
1306
1318
  <div style="font-size:11px;opacity:.6;margin-bottom:6px;">
1307
1319
  Extra tags injected into <code>&lt;head&gt;</code>. CDN links, fonts,
1308
- stylesheets, meta tags.
1320
+ stylesheets, meta tags. Trusted authors only: scripts and event
1321
+ handlers run in the public portal page.
1309
1322
  </div>
1310
1323
  <div
1311
1324
  id="fc-head-wrap"
@@ -1385,7 +1398,12 @@ function useDebounce(value, ms = 300) {
1385
1398
  },
1386
1399
  endpoint: { value: "" },
1387
1400
  pageTitle: { value: "fromcubes" },
1388
- componentCode: { value: STARTER },
1401
+ componentCode: {
1402
+ value: STARTER,
1403
+ validate: function (v) {
1404
+ return typeof v === "string" && v.trim().length > 0;
1405
+ },
1406
+ },
1389
1407
  customHead: { value: "" },
1390
1408
  portalAuth: { value: false },
1391
1409
  showWsStatus: { value: false },
@@ -1423,7 +1441,8 @@ function useDebounce(value, ms = 300) {
1423
1441
  */
1424
1442
  oneditprepare: function () {
1425
1443
  const node = this;
1426
- const code = node.componentCode || STARTER;
1444
+ const code =
1445
+ typeof node.componentCode === "string" ? node.componentCode : STARTER;
1427
1446
  const headCode = node.customHead || "";
1428
1447
  console.log("[FC-Monaco] PORTAL oneditprepare, node.id=" + node.id);
1429
1448
 
@@ -2062,7 +2081,8 @@ const { data, send, user, portalClient } = useNodeRed();
2062
2081
  <h3>Custom Head HTML</h3>
2063
2082
  <p>
2064
2083
  Inject CDN links, fonts, or extra stylesheets into
2065
- <code>&lt;head&gt;</code>. Example:
2084
+ <code>&lt;head&gt;</code>. This is raw trusted-author HTML; scripts and
2085
+ event handlers run in the public portal page. Example:
2066
2086
  </p>
2067
2087
  <pre>
2068
2088
  &lt;link href="https://fonts.googleapis.com/css2?family=Inter&amp;display=swap" rel="stylesheet"&gt;</pre