@dshtrading/client-ui-strategies 0.1.6 → 0.2.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.
package/lib/client.js CHANGED
@@ -8350,7 +8350,11 @@ window.__ModuleLoader__.load({
8350
8350
  if (/^(?:\([a-zA-Z0-9_,\s]*\)|[a-zA-Z0-9_]+)\s*=>/.test(trimmed) || /^function\b/.test(trimmed)) return new Function(`"use strict"; return (${trimmed});`)();
8351
8351
  return new Function("bars", "params", `"use strict";\n${trimmed}`);
8352
8352
  }
8353
- /** blob Worker 内执行的编译+试算脚本(自包含,不依赖宿主任何模块)。 */
8353
+ /**
8354
+ * blob Worker 内执行的编译+试算脚本(自包含,不依赖宿主任何模块)。
8355
+ * 与 compileComputeSource 同构的第三处实现——Worker 内无法 import,镜像不可避免;
8356
+ * 形态嗅探正则与编译语义改动必须同步本段(单一事实来源 = compileComputeSource)。
8357
+ */
8354
8358
  const WORKER_TRIAL_SCRIPT = `self.onmessage = (event) => {
8355
8359
  const { source, bars, params } = event.data
8356
8360
  try {
@@ -8444,12 +8448,12 @@ window.__ModuleLoader__.load({
8444
8448
  "long"
8445
8449
  ];
8446
8450
  const DEFAULT_TIMEOUT_MS = 100;
8447
- /** 将策略源码解析为可执行纯函数(浏览器端 new Function;Node 侧走 vm runner 试算)。 */
8448
- function compileStrategySource(source) {
8449
- const trimmed = source.trim();
8450
- if (/^(?:\([a-zA-Z0-9_,\s]*\)|[a-zA-Z0-9_]+)\s*=>/.test(trimmed) || /^function\b/.test(trimmed)) return new Function(`"use strict"; return (${trimmed});`)();
8451
- return new Function("bars", "params", `"use strict";\n${trimmed}`);
8452
- }
8451
+ /**
8452
+ * 将策略源码解析为可执行纯函数(浏览器端 new Function;Node 侧走 vm runner 试算)。
8453
+ * 编译语义(形态嗅探 + new Function 双形态)的单一来源是 @dshtrading/indicators 的
8454
+ * compileComputeSource——此处仅按策略信号类型收窄返回值(2026-09-09 收敛同体副本)。
8455
+ */
8456
+ const compileStrategySource = compileComputeSource;
8453
8457
  /**
8454
8458
  * 信号序列专用校验(引擎语义对齐:i 收盘确认、i+1 开盘成交可复算)。
8455
8459
  * 返回 undefined = 通过;否则返回人话诊断(模型与 UI 直接可读)。
@@ -9980,30 +9984,30 @@ window.__ModuleLoader__.load({
9980
9984
  document.head.appendChild(tag);
9981
9985
  }
9982
9986
  var StrategyEditor_module_css_default = {
9983
- "paramHeadRow": "_9mrMhW_paramHeadRow",
9984
- "secondaryBtn": "_9mrMhW_secondaryBtn",
9985
- "actionSpacer": "_9mrMhW_actionSpacer",
9986
- "panelHeader": "_9mrMhW_panelHeader",
9987
+ "noticeError": "_9mrMhW_noticeError",
9988
+ "paramRow": "_9mrMhW_paramRow",
9987
9989
  "fieldInput": "_9mrMhW_fieldInput",
9988
- "addParamBtn": "_9mrMhW_addParamBtn",
9989
- "columnHeadRow": "_9mrMhW_columnHeadRow",
9990
- "columnRow": "_9mrMhW_columnRow",
9991
- "panelTitle": "_9mrMhW_panelTitle",
9990
+ "overlay": "_9mrMhW_overlay",
9991
+ "paramTable": "_9mrMhW_paramTable",
9992
+ "actionBar": "_9mrMhW_actionBar",
9992
9993
  "formGrid": "_9mrMhW_formGrid",
9994
+ "paramCell": "_9mrMhW_paramCell",
9993
9995
  "paramRemove": "_9mrMhW_paramRemove",
9994
- "paramTable": "_9mrMhW_paramTable",
9995
- "closeBtn": "_9mrMhW_closeBtn",
9996
- "sourceArea": "_9mrMhW_sourceArea",
9997
- "noticeOk": "_9mrMhW_noticeOk",
9996
+ "columnHeadRow": "_9mrMhW_columnHeadRow",
9998
9997
  "panel": "_9mrMhW_panel",
9999
- "paramRow": "_9mrMhW_paramRow",
10000
- "primaryBtn": "_9mrMhW_primaryBtn",
10001
- "paramCell": "_9mrMhW_paramCell",
10002
- "noticeError": "_9mrMhW_noticeError",
10003
- "actionBar": "_9mrMhW_actionBar",
10004
- "overlay": "_9mrMhW_overlay",
9998
+ "panelTitle": "_9mrMhW_panelTitle",
9999
+ "field": "_9mrMhW_field",
10000
+ "panelHeader": "_9mrMhW_panelHeader",
10001
+ "columnRow": "_9mrMhW_columnRow",
10005
10002
  "fieldLabel": "_9mrMhW_fieldLabel",
10006
- "field": "_9mrMhW_field"
10003
+ "addParamBtn": "_9mrMhW_addParamBtn",
10004
+ "sourceArea": "_9mrMhW_sourceArea",
10005
+ "primaryBtn": "_9mrMhW_primaryBtn",
10006
+ "secondaryBtn": "_9mrMhW_secondaryBtn",
10007
+ "noticeOk": "_9mrMhW_noticeOk",
10008
+ "actionSpacer": "_9mrMhW_actionSpacer",
10009
+ "paramHeadRow": "_9mrMhW_paramHeadRow",
10010
+ "closeBtn": "_9mrMhW_closeBtn"
10007
10011
  };
10008
10012
  //#endregion
10009
10013
  //#region src/client/ScreenerEditor.tsx
@@ -10456,47 +10460,47 @@ window.__ModuleLoader__.load({
10456
10460
  document.head.appendChild(tag);
10457
10461
  }
10458
10462
  var StrategyView_module_css_default = {
10459
- "symbolValue": "jg958W_symbolValue",
10460
- "progressFill": "jg958W_progressFill",
10461
- "metricsGrid": "jg958W_metricsGrid",
10463
+ "cardBadge": "jg958W_cardBadge",
10464
+ "progressWrap": "jg958W_progressWrap",
10465
+ "cardSummary": "jg958W_cardSummary",
10466
+ "cardTitle": "jg958W_cardTitle",
10467
+ "strategyCard": "jg958W_strategyCard",
10462
10468
  "paramGroup": "jg958W_paramGroup",
10463
- "horizonSelector": "jg958W_horizonSelector",
10464
- "header": "jg958W_header",
10469
+ "configBar": "jg958W_configBar",
10470
+ "errorMessage": "jg958W_errorMessage",
10465
10471
  "tableSection": "jg958W_tableSection",
10466
- "mgmtRow": "jg958W_mgmtRow",
10467
- "chartWrapper": "jg958W_chartWrapper",
10468
- "cardActionBtn": "jg958W_cardActionBtn",
10472
+ "header": "jg958W_header",
10473
+ "symbolValue": "jg958W_symbolValue",
10474
+ "metricCard": "jg958W_metricCard",
10469
10475
  "chartContainer": "jg958W_chartContainer",
10476
+ "tradesTable": "jg958W_tradesTable",
10477
+ "tableEmptyCell": "jg958W_tableEmptyCell",
10478
+ "trendUp": "jg958W_trendUp",
10479
+ "mgmtRow": "jg958W_mgmtRow",
10470
10480
  "newStrategyBtn": "jg958W_newStrategyBtn",
10481
+ "horizonBtn": "jg958W_horizonBtn",
10471
10482
  "cardTitleRow": "jg958W_cardTitleRow",
10472
- "strategyCards": "jg958W_strategyCards",
10483
+ "metricsGrid": "jg958W_metricsGrid",
10484
+ "emptyState": "jg958W_emptyState",
10485
+ "paramLabel": "jg958W_paramLabel",
10473
10486
  "runBtn": "jg958W_runBtn",
10474
- "tradesTableWrapper": "jg958W_tradesTableWrapper",
10475
- "cardSummary": "jg958W_cardSummary",
10476
- "progressWrap": "jg958W_progressWrap",
10477
- "trendDown": "jg958W_trendDown",
10478
- "errorMessage": "jg958W_errorMessage",
10479
- "reasonCell": "jg958W_reasonCell",
10480
- "scanMeta": "jg958W_scanMeta",
10481
- "horizonBtn": "jg958W_horizonBtn",
10482
10487
  "nameCell": "jg958W_nameCell",
10483
- "emptyState": "jg958W_emptyState",
10484
- "trendUp": "jg958W_trendUp",
10485
- "cardActions": "jg958W_cardActions",
10486
- "strategyCard": "jg958W_strategyCard",
10487
- "emptyIcon": "jg958W_emptyIcon",
10488
- "configBar": "jg958W_configBar",
10489
- "cardTitle": "jg958W_cardTitle",
10488
+ "chartWrapper": "jg958W_chartWrapper",
10489
+ "trendDown": "jg958W_trendDown",
10490
10490
  "paramInput": "jg958W_paramInput",
10491
+ "root": "jg958W_root",
10492
+ "scanMeta": "jg958W_scanMeta",
10493
+ "progressFill": "jg958W_progressFill",
10494
+ "metricValue": "jg958W_metricValue",
10491
10495
  "tableTitle": "jg958W_tableTitle",
10492
- "tradesTable": "jg958W_tradesTable",
10493
- "tableEmptyCell": "jg958W_tableEmptyCell",
10496
+ "cardActionBtn": "jg958W_cardActionBtn",
10497
+ "horizonSelector": "jg958W_horizonSelector",
10498
+ "reasonCell": "jg958W_reasonCell",
10499
+ "emptyIcon": "jg958W_emptyIcon",
10500
+ "cardActions": "jg958W_cardActions",
10494
10501
  "metricLabel": "jg958W_metricLabel",
10495
- "metricValue": "jg958W_metricValue",
10496
- "metricCard": "jg958W_metricCard",
10497
- "cardBadge": "jg958W_cardBadge",
10498
- "root": "jg958W_root",
10499
- "paramLabel": "jg958W_paramLabel"
10502
+ "tradesTableWrapper": "jg958W_tradesTableWrapper",
10503
+ "strategyCards": "jg958W_strategyCards"
10500
10504
  };
10501
10505
  //#endregion
10502
10506
  //#region src/client/ScreenerPane.tsx
@@ -12101,18 +12105,18 @@ window.__ModuleLoader__.load({
12101
12105
  document.head.appendChild(tag);
12102
12106
  }
12103
12107
  var toolview_module_css_default = {
12104
- "head": "MbbyQa_head",
12105
- "metrics": "MbbyQa_metrics",
12108
+ "spark": "MbbyQa_spark",
12106
12109
  "params": "MbbyQa_params",
12110
+ "metricValue": "MbbyQa_metricValue",
12111
+ "card": "MbbyQa_card",
12107
12112
  "reason": "MbbyQa_reason",
12108
12113
  "title": "MbbyQa_title",
12109
- "chip": "MbbyQa_chip",
12110
- "spark": "MbbyQa_spark",
12111
- "card": "MbbyQa_card",
12114
+ "meta": "MbbyQa_meta",
12115
+ "metrics": "MbbyQa_metrics",
12112
12116
  "metric": "MbbyQa_metric",
12113
12117
  "metricLabel": "MbbyQa_metricLabel",
12114
- "metricValue": "MbbyQa_metricValue",
12115
- "meta": "MbbyQa_meta"
12118
+ "head": "MbbyQa_head",
12119
+ "chip": "MbbyQa_chip"
12116
12120
  };
12117
12121
  //#endregion
12118
12122
  //#region src/client/toolview.tsx