@trdrs/quickcharts 5.9.0 → 5.10.0
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/CHANGELOG.md +16 -0
- package/README.md +103 -21
- package/dist/{ar-UCEHBM7A.js → ar-CFMLQMWS.js} +87 -12
- package/dist/ar-CFMLQMWS.js.map +1 -0
- package/dist/{assets-BlTu7v6I.d.ts → assets-_zQbuobs.d.ts} +135 -18
- package/dist/{ca_ES-BFGULOZT.js → ca_ES-OTOMJJ2G.js} +87 -12
- package/dist/ca_ES-OTOMJJ2G.js.map +1 -0
- package/dist/{chunk-6OLK55Q2.js → chunk-3GGBHQAE.js} +1 -1
- package/dist/chunk-3GGBHQAE.js.map +1 -0
- package/dist/{chunk-QDGOF34R.js → chunk-NWUGE6XN.js} +53 -14
- package/dist/chunk-NWUGE6XN.js.map +1 -0
- package/dist/{de-GCEC2EYH.js → de-BJ5E7LGZ.js} +86 -11
- package/dist/de-BJ5E7LGZ.js.map +1 -0
- package/dist/drawings.d.ts +2 -2
- package/dist/drawings.js +1 -1
- package/dist/{es-ZB54BYRR.js → es-PO36YPXJ.js} +87 -12
- package/dist/es-PO36YPXJ.js.map +1 -0
- package/dist/feature-manifest.json +74 -1
- package/dist/format.d.ts +2 -2
- package/dist/format.js +1 -1
- package/dist/{fr-G4UQFXAQ.js → fr-A4WAZ3K4.js} +87 -12
- package/dist/fr-A4WAZ3K4.js.map +1 -0
- package/dist/{he_IL-WWCSQOSV.js → he_IL-Q3BO4MEG.js} +87 -12
- package/dist/he_IL-Q3BO4MEG.js.map +1 -0
- package/dist/{id_ID-7F2V4KIE.js → id_ID-K22OKQPH.js} +87 -12
- package/dist/id_ID-K22OKQPH.js.map +1 -0
- package/dist/index.d.ts +457 -226
- package/dist/index.js +878 -298
- package/dist/index.js.map +1 -1
- package/dist/{it-ACKDFMK4.js → it-DPPNAWOV.js} +87 -12
- package/dist/it-DPPNAWOV.js.map +1 -0
- package/dist/{ja-O64YJRIH.js → ja-U7C5N3LG.js} +86 -11
- package/dist/ja-U7C5N3LG.js.map +1 -0
- package/dist/{ko-ZVNVRNQC.js → ko-5LFLZG7S.js} +87 -12
- package/dist/ko-5LFLZG7S.js.map +1 -0
- package/dist/{ms_MY-3OXH5BKH.js → ms_MY-H75T2Q5A.js} +87 -12
- package/dist/ms_MY-H75T2Q5A.js.map +1 -0
- package/dist/{pl-22JL2HZV.js → pl-3YOKB2BS.js} +87 -12
- package/dist/pl-3YOKB2BS.js.map +1 -0
- package/dist/{pt-P4JJ5ICZ.js → pt-PEX6C6L5.js} +87 -12
- package/dist/pt-PEX6C6L5.js.map +1 -0
- package/dist/quickcharts.css +310 -121
- package/dist/{ru-YC5ROSB7.js → ru-4NPNXA7E.js} +87 -12
- package/dist/ru-4NPNXA7E.js.map +1 -0
- package/dist/{sv-X5EQXKFO.js → sv-BY5AK2AT.js} +87 -12
- package/dist/sv-BY5AK2AT.js.map +1 -0
- package/dist/{symbology-D3SLclrU.d.ts → symbology-BfPxIJjT.d.ts} +8 -5
- package/dist/{symbols-DNMxzgfN.d.ts → symbols-BxtRs6Uu.d.ts} +1 -1
- package/dist/symbols.d.ts +2 -2
- package/dist/{th-3JWJOZ46.js → th-ITZ7VOMZ.js} +87 -12
- package/dist/th-ITZ7VOMZ.js.map +1 -0
- package/dist/theme-manifest.json +141 -20
- package/dist/{tr-E3WXPPX4.js → tr-D4GW77TN.js} +87 -12
- package/dist/tr-D4GW77TN.js.map +1 -0
- package/dist/{vi-4YVVQQHU.js → vi-H4RJW4FL.js} +87 -12
- package/dist/vi-H4RJW4FL.js.map +1 -0
- package/dist/{zh-GTCA4GAB.js → zh-3QGRRBGK.js} +86 -11
- package/dist/zh-3QGRRBGK.js.map +1 -0
- package/dist/{zh_TW-47TPXCBL.js → zh_TW-45CVENDQ.js} +86 -11
- package/dist/zh_TW-45CVENDQ.js.map +1 -0
- package/package.json +1 -1
- package/dist/ar-UCEHBM7A.js.map +0 -1
- package/dist/ca_ES-BFGULOZT.js.map +0 -1
- package/dist/chunk-6OLK55Q2.js.map +0 -1
- package/dist/chunk-QDGOF34R.js.map +0 -1
- package/dist/de-GCEC2EYH.js.map +0 -1
- package/dist/es-ZB54BYRR.js.map +0 -1
- package/dist/fr-G4UQFXAQ.js.map +0 -1
- package/dist/he_IL-WWCSQOSV.js.map +0 -1
- package/dist/id_ID-7F2V4KIE.js.map +0 -1
- package/dist/it-ACKDFMK4.js.map +0 -1
- package/dist/ja-O64YJRIH.js.map +0 -1
- package/dist/ko-ZVNVRNQC.js.map +0 -1
- package/dist/ms_MY-3OXH5BKH.js.map +0 -1
- package/dist/pl-22JL2HZV.js.map +0 -1
- package/dist/pt-P4JJ5ICZ.js.map +0 -1
- package/dist/ru-YC5ROSB7.js.map +0 -1
- package/dist/sv-X5EQXKFO.js.map +0 -1
- package/dist/th-3JWJOZ46.js.map +0 -1
- package/dist/tr-E3WXPPX4.js.map +0 -1
- package/dist/vi-4YVVQQHU.js.map +0 -1
- package/dist/zh-GTCA4GAB.js.map +0 -1
- package/dist/zh_TW-47TPXCBL.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
withRow,
|
|
116
116
|
withoutColumn,
|
|
117
117
|
withoutRow
|
|
118
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-NWUGE6XN.js";
|
|
119
119
|
import {
|
|
120
120
|
ResourceAbortError,
|
|
121
121
|
memorySaveLoadAdapter
|
|
@@ -137,7 +137,7 @@ import {
|
|
|
137
137
|
createPriceFormatter,
|
|
138
138
|
parseTickBands,
|
|
139
139
|
tickBandFor
|
|
140
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-3GGBHQAE.js";
|
|
141
141
|
import {
|
|
142
142
|
EMOJI_CATEGORIES,
|
|
143
143
|
ICON_CATEGORIES,
|
|
@@ -231,6 +231,20 @@ var TIMEFRAME_COUNT_NAME = {
|
|
|
231
231
|
w: "timeframe.countWeeks",
|
|
232
232
|
mo: "timeframe.countMonths"
|
|
233
233
|
};
|
|
234
|
+
var TIMEFRAME_TIP_NAME = {
|
|
235
|
+
t: "timeframe.tipTicks",
|
|
236
|
+
s: "timeframe.tipSeconds",
|
|
237
|
+
m: "timeframe.tipMinutes",
|
|
238
|
+
h: "timeframe.tipHours",
|
|
239
|
+
d: "timeframe.tipDays",
|
|
240
|
+
w: "timeframe.tipWeeks",
|
|
241
|
+
mo: "timeframe.tipMonths"
|
|
242
|
+
};
|
|
243
|
+
function timeframeTip(t, token) {
|
|
244
|
+
const tf = parseTimeframe(token);
|
|
245
|
+
if (!tf) return token;
|
|
246
|
+
return t(TIMEFRAME_TIP_NAME[tf.unit], { count: tf.count });
|
|
247
|
+
}
|
|
234
248
|
function timeframeLabel(t, token) {
|
|
235
249
|
const tf = parseTimeframe(token);
|
|
236
250
|
if (!tf) return token;
|
|
@@ -391,7 +405,7 @@ function udfPriceFormat(raw) {
|
|
|
391
405
|
}
|
|
392
406
|
return format2;
|
|
393
407
|
}
|
|
394
|
-
var SUBSESSION_IDS = ["regular", "extended", "premarket", "postmarket"];
|
|
408
|
+
var SUBSESSION_IDS = ["regular", "extended", "premarket", "postmarket", "overnight"];
|
|
395
409
|
function udfSubsessions(raw) {
|
|
396
410
|
const out = [];
|
|
397
411
|
for (const entry of raw ?? []) {
|
|
@@ -790,7 +804,9 @@ var legend = {
|
|
|
790
804
|
// both open belongs to the search family (search.ts).
|
|
791
805
|
"legend.changeSymbol": "Change symbol",
|
|
792
806
|
"legend.removeCompare": "Remove comparison",
|
|
793
|
-
"legend.removeIndicator": "Remove indicator"
|
|
807
|
+
"legend.removeIndicator": "Remove indicator",
|
|
808
|
+
/** The bubble of a row's eye while the row is hidden. */
|
|
809
|
+
"legend.show": "Show"
|
|
794
810
|
};
|
|
795
811
|
|
|
796
812
|
// src/i18n/en/tools.ts
|
|
@@ -1006,7 +1022,7 @@ var session = {
|
|
|
1006
1022
|
"session.pre": "Pre-market",
|
|
1007
1023
|
"session.open": "Market open",
|
|
1008
1024
|
"session.extended": "Extended hours",
|
|
1009
|
-
"session.after": "
|
|
1025
|
+
"session.after": "Post-market",
|
|
1010
1026
|
"session.closed": "Market closed"
|
|
1011
1027
|
};
|
|
1012
1028
|
|
|
@@ -1256,12 +1272,24 @@ var timeframe = {
|
|
|
1256
1272
|
"timeframe.customUnit": "Custom timeframe unit",
|
|
1257
1273
|
"timeframe.addCustom": "Add custom timeframe",
|
|
1258
1274
|
"timeframe.increment": "Increment",
|
|
1259
|
-
"timeframe.decrement": "Decrement"
|
|
1275
|
+
"timeframe.decrement": "Decrement",
|
|
1276
|
+
/** The words the timeframe controls' bubbles show: the caret, and a counted timeframe in a
|
|
1277
|
+
* sentence: '1m' reads "1 minute". */
|
|
1278
|
+
"timeframe.intervalTip": "Chart interval",
|
|
1279
|
+
"timeframe.tipTicks": { one: "{count} tick", other: "{count} ticks" },
|
|
1280
|
+
"timeframe.tipSeconds": { one: "{count} second", other: "{count} seconds" },
|
|
1281
|
+
"timeframe.tipMinutes": { one: "{count} minute", other: "{count} minutes" },
|
|
1282
|
+
"timeframe.tipHours": { one: "{count} hour", other: "{count} hours" },
|
|
1283
|
+
"timeframe.tipDays": { one: "{count} day", other: "{count} days" },
|
|
1284
|
+
"timeframe.tipWeeks": { one: "{count} week", other: "{count} weeks" },
|
|
1285
|
+
"timeframe.tipMonths": { one: "{count} month", other: "{count} months" }
|
|
1260
1286
|
};
|
|
1261
1287
|
|
|
1262
1288
|
// src/i18n/en/timezone.ts
|
|
1263
1289
|
var timezone = {
|
|
1264
1290
|
"timezone.title": "Chart timezone",
|
|
1291
|
+
/** The bubble of the bottom bar's clock. */
|
|
1292
|
+
"timezone.tip": "Timezone",
|
|
1265
1293
|
/** The row that follows the charted symbol's exchange clock. */
|
|
1266
1294
|
"timezone.exchange": "Exchange",
|
|
1267
1295
|
/** The quarter of a year a date format writes, such as Q3. */
|
|
@@ -1281,6 +1309,25 @@ var range = {
|
|
|
1281
1309
|
"range.all": "All data",
|
|
1282
1310
|
/** A preset's tooltip: what it frames, and the bars it frames it in. */
|
|
1283
1311
|
"range.tip": "{range} \xB7 {timeframe} bars",
|
|
1312
|
+
/** A preset's bubble: what it frames, in a sentence, and the bars it frames it in. `{timeframe}` is
|
|
1313
|
+
* the bar size as the sentence says it (one of the `range.interval*` keys). */
|
|
1314
|
+
"range.tipIntervals": "{range} in {timeframe} intervals",
|
|
1315
|
+
/** The bar size in a preset's bubble, as `range.tipIntervals` says it. English puts it before
|
|
1316
|
+
* "intervals", where a count takes the singular: "5 minute intervals". */
|
|
1317
|
+
"range.intervalTicks": { one: "{count} tick", other: "{count} tick" },
|
|
1318
|
+
"range.intervalSeconds": { one: "{count} second", other: "{count} second" },
|
|
1319
|
+
"range.intervalMinutes": { one: "{count} minute", other: "{count} minute" },
|
|
1320
|
+
"range.intervalHours": { one: "{count} hour", other: "{count} hour" },
|
|
1321
|
+
"range.intervalDays": { one: "{count} day", other: "{count} day" },
|
|
1322
|
+
"range.intervalWeeks": { one: "{count} week", other: "{count} week" },
|
|
1323
|
+
"range.intervalMonths": { one: "{count} month", other: "{count} month" },
|
|
1324
|
+
"range.tipOneDay": "1 day",
|
|
1325
|
+
"range.tipFiveDays": "5 days",
|
|
1326
|
+
"range.tipOneMonth": "1 month",
|
|
1327
|
+
"range.tipThreeMonths": "3 months",
|
|
1328
|
+
"range.tipSixMonths": "6 months",
|
|
1329
|
+
"range.tipOneYear": "1 year",
|
|
1330
|
+
"range.tipFiveYears": "5 years",
|
|
1284
1331
|
"range.zoomIn": "Zoom in",
|
|
1285
1332
|
"range.zoomOut": "Zoom out",
|
|
1286
1333
|
"range.scrollLeft": "Scroll left",
|
|
@@ -1295,18 +1342,51 @@ var status = {
|
|
|
1295
1342
|
"status.title": "Market status",
|
|
1296
1343
|
"status.unknownTitle": "Session unknown",
|
|
1297
1344
|
"status.unknown": "This symbol's trading session has not resolved yet.",
|
|
1298
|
-
/** The feed serves one bar a day after the close:
|
|
1299
|
-
|
|
1300
|
-
"status.
|
|
1301
|
-
|
|
1345
|
+
/** The data section for a feed that serves one bar a day after the close: its title and its
|
|
1346
|
+
* sentence. */
|
|
1347
|
+
"status.endOfDayTitle": "End-of-day data",
|
|
1348
|
+
"status.endOfDay": "Prices update once a day, after the session ends.",
|
|
1349
|
+
/** The data section for a delayed stream: its title and its sentence. */
|
|
1350
|
+
"status.delayedTitle": "Data is delayed",
|
|
1351
|
+
"status.delayedText": "This symbol's prices are delayed.",
|
|
1352
|
+
/** The titles of the two phases the session names do not cover. */
|
|
1353
|
+
"status.overnightTitle": "Overnight",
|
|
1354
|
+
"status.holidayTitle": "Holiday",
|
|
1355
|
+
/** The sentence under each phase's title. An open market and a continuous one say the same. */
|
|
1356
|
+
"status.openText": "All's well, market is open.",
|
|
1357
|
+
"status.preText": "Morning. Market is open for pre-market trading.",
|
|
1358
|
+
"status.postText": "Evening. Market is open for post-market trading.",
|
|
1359
|
+
"status.overnightText": "Hey there, night owl. Market is currently open for overnight trading.",
|
|
1360
|
+
"status.extended": "Market is open for extended-hours trading.",
|
|
1361
|
+
"status.closedText": "Time for a walk, this market is closed.",
|
|
1362
|
+
"status.holidayText": "Market is currently on holiday. Lucky them.",
|
|
1363
|
+
/** The countdown, in bold after the sentence, named for where the market goes next. */
|
|
1364
|
+
"status.closesIn": "It'll close in {until}.",
|
|
1365
|
+
"status.postMarketIn": "It'll go to post-market trading in {until}.",
|
|
1366
|
+
"status.overnightIn": "Overnight trading will start in {until}.",
|
|
1367
|
+
"status.extendedIn": "It'll go to extended-hours trading in {until}.",
|
|
1368
|
+
"status.preMarketIn": "Pre-market will start in {until}.",
|
|
1369
|
+
"status.opensFullyIn": "It'll open fully in {until}.",
|
|
1370
|
+
"status.opensPreMarketIn": "It'll open for pre-market trading in {until}.",
|
|
1371
|
+
"status.opensIn": "It'll open in {until}.",
|
|
1372
|
+
/** The sentence and the countdown as one line of text. */
|
|
1373
|
+
"status.textPair": "{sentence} {countdown}",
|
|
1374
|
+
/** The footer under the timeline; `{zone}` is the exchange city and offset. */
|
|
1375
|
+
"status.exchangeTimezone": "Exchange timezone: {zone}",
|
|
1376
|
+
// The countdown that fills {until}: one unit, or the coarser unit followed by the finer one.
|
|
1377
|
+
// `durationPair` owns the order and the joining words, so a language decides both.
|
|
1378
|
+
"status.durationDays": { one: "{count} day", other: "{count} days" },
|
|
1379
|
+
"status.durationHours": { one: "{count} hour", other: "{count} hours" },
|
|
1380
|
+
"status.durationMinutes": { one: "{count} minute", other: "{count} minutes" },
|
|
1381
|
+
"status.durationPair": "{major} and {minor}",
|
|
1382
|
+
// The chart reads none of these. They stay in the catalog until the next major, since a
|
|
1383
|
+
// dictionary of your own carries every key of the major's baseline.
|
|
1302
1384
|
"status.delayed": "Prices are delayed.",
|
|
1303
1385
|
"status.delayedPair": "{status} {delay}",
|
|
1304
|
-
/** A `24x7` market. */
|
|
1305
1386
|
"status.continuousTitle": "Open 24/7",
|
|
1306
1387
|
"status.continuous": "This market trades around the clock and never closes.",
|
|
1307
1388
|
"status.open": "Market is open for regular trading.",
|
|
1308
1389
|
"status.openCloses": "Market is open for regular trading. Closes in {until}.",
|
|
1309
|
-
"status.extended": "Market is open for extended-hours trading.",
|
|
1310
1390
|
"status.extendedRegular": "Market is open for extended-hours trading. Regular hours start in {until}.",
|
|
1311
1391
|
"status.extendedCloses": "Market is open for extended-hours trading. Closes in {until}.",
|
|
1312
1392
|
"status.pre": "Market is open for pre-market trading.",
|
|
@@ -1315,15 +1395,7 @@ var status = {
|
|
|
1315
1395
|
"status.afterEnds": "Market is open for after-hours trading. Ends in {until}.",
|
|
1316
1396
|
"status.closed": "Market is closed.",
|
|
1317
1397
|
"status.closedPre": "Market is closed. Pre-market starts in {until}.",
|
|
1318
|
-
"status.closedOpens": "Market is closed. Opens in {until}."
|
|
1319
|
-
/** The footer under the timeline; `{zone}` is the exchange city and offset. */
|
|
1320
|
-
"status.exchangeTimezone": "Exchange timezone: {zone}",
|
|
1321
|
-
// The countdown that fills {until}: one unit, or the coarser unit followed by the finer one.
|
|
1322
|
-
// `durationPair` owns the order and the separator, so a language decides both.
|
|
1323
|
-
"status.durationDays": { one: "{count} day", other: "{count} days" },
|
|
1324
|
-
"status.durationHours": { one: "{count} hour", other: "{count} hours" },
|
|
1325
|
-
"status.durationMinutes": { one: "{count} minute", other: "{count} minutes" },
|
|
1326
|
-
"status.durationPair": "{major} {minor}"
|
|
1398
|
+
"status.closedOpens": "Market is closed. Opens in {until}."
|
|
1327
1399
|
};
|
|
1328
1400
|
|
|
1329
1401
|
// src/i18n/en/search.ts
|
|
@@ -1353,6 +1425,9 @@ var search = {
|
|
|
1353
1425
|
* `{count}` is how many other venues the instrument lists on, which the pill opens beneath the
|
|
1354
1426
|
* row; whether they are showing is the pill's expanded state. */
|
|
1355
1427
|
"search.moreListings": { one: "{count} more listing", other: "{count} more listings" },
|
|
1428
|
+
/** The bubble of a grouped row's pill: what a press does to the group. */
|
|
1429
|
+
"search.expand": "Expand",
|
|
1430
|
+
"search.collapse": "Collapse",
|
|
1356
1431
|
// The asset-class filter strip: the chip for every class, and the strip's own name.
|
|
1357
1432
|
"search.allClasses": "All",
|
|
1358
1433
|
"search.classFilter": "Asset class",
|
|
@@ -1521,9 +1596,20 @@ var chrome = {
|
|
|
1521
1596
|
* which replay is meant. Its accessible name stays the full one above. */
|
|
1522
1597
|
"chrome.replayChip": "Replay",
|
|
1523
1598
|
"chrome.image": "Chart image",
|
|
1599
|
+
/** The words the top bar's bubbles show where they differ from a control's name. */
|
|
1600
|
+
"chrome.compareTip": "Compare symbols",
|
|
1601
|
+
"chrome.indicatorsTip": "Indicators and strategies",
|
|
1602
|
+
"chrome.settingsTip": "Settings",
|
|
1603
|
+
"chrome.fullscreenTip": "Fullscreen mode",
|
|
1604
|
+
"chrome.imageTip": "Take a snapshot",
|
|
1524
1605
|
/** The bottom bar's session-view trigger. Its clock and timezone trigger reads `timezone.title`. */
|
|
1525
1606
|
"chrome.session": "Trading session",
|
|
1526
1607
|
"chrome.sessionsHeading": "Sessions",
|
|
1608
|
+
/** The trading hours the session-view trigger names in its short form: extended or electronic
|
|
1609
|
+
* trading hours, regular trading hours, and 24 hours. */
|
|
1610
|
+
"chrome.sessionShortExtended": "ETH",
|
|
1611
|
+
"chrome.sessionShortRegular": "RTH",
|
|
1612
|
+
"chrome.sessionShortAllHours": "24H",
|
|
1527
1613
|
/** The on-chart navigation cluster's group name. */
|
|
1528
1614
|
"chrome.navigation": "Chart navigation",
|
|
1529
1615
|
/** The active chart's identity as the toolbar reads it aloud; `{symbol}` and `{timeframe}` are data. */
|
|
@@ -1600,6 +1686,9 @@ var picker = {
|
|
|
1600
1686
|
"picker.author": "Author",
|
|
1601
1687
|
"picker.favorite": "Favorite {name}",
|
|
1602
1688
|
"picker.unfavorite": "Unfavorite {name}",
|
|
1689
|
+
/** The bubbles of a row's star. */
|
|
1690
|
+
"picker.favoriteTip": "Add to favorites",
|
|
1691
|
+
"picker.unfavoriteTip": "Remove from favorites",
|
|
1603
1692
|
"picker.loading": "Loading indicators\u2026",
|
|
1604
1693
|
"picker.unavailable": "Indicator content is unavailable. Try again.",
|
|
1605
1694
|
"picker.actionFailed": "The action could not be completed. Try again.",
|
|
@@ -1655,16 +1744,22 @@ var settings = {
|
|
|
1655
1744
|
"settings.fillBottomArea": "Fill bottom area",
|
|
1656
1745
|
"settings.baseLevel": "Base level",
|
|
1657
1746
|
"settings.headingDataModification": "Data modification",
|
|
1658
|
-
/** Which trading hours an intraday chart shows.
|
|
1747
|
+
/** Which trading hours an intraday chart shows. A split day offers regular and extended hours, and
|
|
1748
|
+
* 24 hours when it trades overnight; an electronic day offers its electronic and its regular
|
|
1749
|
+
* trading hours. */
|
|
1659
1750
|
"settings.session": "Session",
|
|
1660
1751
|
"settings.sessionRegular": "Regular",
|
|
1661
1752
|
"settings.sessionExtended": "Extended",
|
|
1662
1753
|
"settings.sessionAllHours": "24 hours",
|
|
1754
|
+
"settings.sessionElectronic": "Electronic trading hours",
|
|
1755
|
+
"settings.sessionRegularHours": "Regular trading hours",
|
|
1663
1756
|
"settings.extendedHoursBackground": "Pre/post market hours background",
|
|
1664
1757
|
"settings.allHoursBackground": "Pre/post/night market hours background",
|
|
1758
|
+
"settings.electronicHoursBackground": "Electronic trading hours background",
|
|
1665
1759
|
"settings.preMarket": "Pre-market",
|
|
1666
1760
|
"settings.postMarket": "Post-market",
|
|
1667
1761
|
"settings.night": "Night",
|
|
1762
|
+
"settings.electronic": "Electronic",
|
|
1668
1763
|
"settings.precision": "Precision",
|
|
1669
1764
|
"settings.precisionDefault": "Default",
|
|
1670
1765
|
"settings.precisionInteger": "Integer",
|
|
@@ -1846,26 +1941,26 @@ function readingDirection(i18n) {
|
|
|
1846
1941
|
return BUILT_IN_LOCALES.find((l) => l.code === i18n.locale())?.dir ?? "ltr";
|
|
1847
1942
|
}
|
|
1848
1943
|
var chartDictionaries = createDictionaryLoader(en, {
|
|
1849
|
-
de: () => import("./de-
|
|
1850
|
-
fr: () => import("./fr-
|
|
1851
|
-
es: () => import("./es-
|
|
1852
|
-
it: () => import("./it-
|
|
1853
|
-
ca_ES: () => import("./ca_ES-
|
|
1854
|
-
pl: () => import("./pl-
|
|
1855
|
-
sv: () => import("./sv-
|
|
1856
|
-
tr: () => import("./tr-
|
|
1857
|
-
ru: () => import("./ru-
|
|
1858
|
-
pt: () => import("./pt-
|
|
1859
|
-
id_ID: () => import("./id_ID-
|
|
1860
|
-
ms_MY: () => import("./ms_MY-
|
|
1861
|
-
th: () => import("./th-
|
|
1862
|
-
vi: () => import("./vi-
|
|
1863
|
-
ja: () => import("./ja-
|
|
1864
|
-
ko: () => import("./ko-
|
|
1865
|
-
zh: () => import("./zh-
|
|
1866
|
-
zh_TW: () => import("./zh_TW-
|
|
1867
|
-
ar: () => import("./ar-
|
|
1868
|
-
he_IL: () => import("./he_IL-
|
|
1944
|
+
de: () => import("./de-BJ5E7LGZ.js"),
|
|
1945
|
+
fr: () => import("./fr-A4WAZ3K4.js"),
|
|
1946
|
+
es: () => import("./es-PO36YPXJ.js"),
|
|
1947
|
+
it: () => import("./it-DPPNAWOV.js"),
|
|
1948
|
+
ca_ES: () => import("./ca_ES-OTOMJJ2G.js"),
|
|
1949
|
+
pl: () => import("./pl-3YOKB2BS.js"),
|
|
1950
|
+
sv: () => import("./sv-BY5AK2AT.js"),
|
|
1951
|
+
tr: () => import("./tr-D4GW77TN.js"),
|
|
1952
|
+
ru: () => import("./ru-4NPNXA7E.js"),
|
|
1953
|
+
pt: () => import("./pt-PEX6C6L5.js"),
|
|
1954
|
+
id_ID: () => import("./id_ID-K22OKQPH.js"),
|
|
1955
|
+
ms_MY: () => import("./ms_MY-H75T2Q5A.js"),
|
|
1956
|
+
th: () => import("./th-ITZ7VOMZ.js"),
|
|
1957
|
+
vi: () => import("./vi-H4RJW4FL.js"),
|
|
1958
|
+
ja: () => import("./ja-U7C5N3LG.js"),
|
|
1959
|
+
ko: () => import("./ko-5LFLZG7S.js"),
|
|
1960
|
+
zh: () => import("./zh-3QGRRBGK.js"),
|
|
1961
|
+
zh_TW: () => import("./zh_TW-45CVENDQ.js"),
|
|
1962
|
+
ar: () => import("./ar-CFMLQMWS.js"),
|
|
1963
|
+
he_IL: () => import("./he_IL-Q3BO4MEG.js")
|
|
1869
1964
|
});
|
|
1870
1965
|
var dynamic = (t) => t;
|
|
1871
1966
|
var source = null;
|
|
@@ -1969,8 +2064,9 @@ var THEME_ROLES = [
|
|
|
1969
2064
|
contrast: [{ over: "scale.crosshairLabelBackground", min: 4.5 }]
|
|
1970
2065
|
},
|
|
1971
2066
|
{ id: "scale.sessionPreMarket", family: "scale", kind: "color", description: "Shading over pre-market bars." },
|
|
1972
|
-
{ id: "scale.sessionExtended", family: "scale", kind: "color", description: "Shading over
|
|
1973
|
-
{ id: "scale.sessionAfterHours", family: "scale", kind: "color", description: "Shading over
|
|
2067
|
+
{ id: "scale.sessionExtended", family: "scale", kind: "color", description: "Shading over overnight and other extended-hours bars." },
|
|
2068
|
+
{ id: "scale.sessionAfterHours", family: "scale", kind: "color", description: "Shading over post-market bars." },
|
|
2069
|
+
{ id: "scale.sessionElectronic", family: "scale", kind: "color", description: "Shading over the bars of an electronic trading day outside its regular hours." },
|
|
1974
2070
|
{ id: "scale.sessionClosed", family: "scale", kind: "color", description: "Shading over bars while the market is closed." },
|
|
1975
2071
|
// ── text: ink and the type roles canvas and DOM must agree on ───────────────────────────────
|
|
1976
2072
|
// The ink roles are read on the plain surface and, inside a menu, picker or search row, on the
|
|
@@ -2184,11 +2280,21 @@ var THEME_ROLES = [
|
|
|
2184
2280
|
{ id: "status.warning", family: "status", kind: "color", description: "A condition the reader should notice before acting.", contrast: [{ over: "chrome.surface", min: 4.5 }] },
|
|
2185
2281
|
{ id: "status.info", family: "status", kind: "color", description: "An informational note in chart chrome.", contrast: [{ over: "chrome.surface", min: 4.5 }] },
|
|
2186
2282
|
{ id: "status.loading", family: "status", kind: "color", description: "The indicator shown while the chart waits for data." },
|
|
2187
|
-
{ id: "status.sessionPreMarket", family: "status", kind: "color", description: "The
|
|
2188
|
-
{ id: "status.
|
|
2189
|
-
{ id: "status.
|
|
2190
|
-
{ id: "status.
|
|
2191
|
-
{ id: "status.
|
|
2283
|
+
{ id: "status.sessionPreMarket", family: "status", kind: "color", description: "The status mark, the title and the timeline stretch for pre-market." },
|
|
2284
|
+
{ id: "status.sessionPreMarketTint", family: "status", kind: "color", description: "The circle behind the pre-market status mark." },
|
|
2285
|
+
{ id: "status.sessionOpen", family: "status", kind: "color", description: "The status mark, the title and the timeline stretch while the market is open." },
|
|
2286
|
+
{ id: "status.sessionOpenTint", family: "status", kind: "color", description: "The circle behind the open market status mark." },
|
|
2287
|
+
{ id: "status.sessionExtended", family: "status", kind: "color", description: "The status mark, the title and the timeline stretch for overnight and extended hours." },
|
|
2288
|
+
{ id: "status.sessionExtendedTint", family: "status", kind: "color", description: "The circle behind the overnight and extended-hours status mark." },
|
|
2289
|
+
{ id: "status.sessionAfterHours", family: "status", kind: "color", description: "The status mark, the title and the timeline stretch for post-market." },
|
|
2290
|
+
{ id: "status.sessionAfterHoursTint", family: "status", kind: "color", description: "The circle behind the post-market status mark." },
|
|
2291
|
+
{ id: "status.sessionClosed", family: "status", kind: "color", description: "The status mark and the title while the market is closed, a holiday included." },
|
|
2292
|
+
{ id: "status.sessionClosedTint", family: "status", kind: "color", description: "The circle behind the closed market status mark." },
|
|
2293
|
+
{ id: "status.sessionTrack", family: "status", kind: "color", description: "The closed stretches of the status popup's timeline." },
|
|
2294
|
+
{ id: "status.dataDelayed", family: "status", kind: "color", description: "The status mark and the title for delayed data." },
|
|
2295
|
+
{ id: "status.dataDelayedTint", family: "status", kind: "color", description: "The circle behind the delayed data status mark." },
|
|
2296
|
+
{ id: "status.dataEndOfDay", family: "status", kind: "color", description: "The status mark and the title for end-of-day data." },
|
|
2297
|
+
{ id: "status.dataEndOfDayTint", family: "status", kind: "color", description: "The circle behind the end-of-day data status mark." },
|
|
2192
2298
|
// ── illustration: the art an empty state stands on ──────────────────────────────────────────
|
|
2193
2299
|
// An illustration says nothing the words beside it do not, so it holds the non-text ratio rather
|
|
2194
2300
|
// than a text one: the drawing and its badge against the dialog, and the mark against the badge.
|
|
@@ -2396,6 +2502,7 @@ function canvasTheme(theme) {
|
|
|
2396
2502
|
preMarket: theme["scale.sessionPreMarket"],
|
|
2397
2503
|
extended: theme["scale.sessionExtended"],
|
|
2398
2504
|
afterHours: theme["scale.sessionAfterHours"],
|
|
2505
|
+
electronic: theme["scale.sessionElectronic"],
|
|
2399
2506
|
closed: theme["scale.sessionClosed"]
|
|
2400
2507
|
}
|
|
2401
2508
|
};
|
|
@@ -4440,7 +4547,32 @@ function rangeAvailable(preset, earliestBarSecs, nowSecs = Math.floor(Date.now()
|
|
|
4440
4547
|
if (preset.span === "ytd") return earliestBarSecs <= yearStart(nowSecs);
|
|
4441
4548
|
return nowSecs - earliestBarSecs >= preset.span;
|
|
4442
4549
|
}
|
|
4550
|
+
var RANGE_TIP_NAME = {
|
|
4551
|
+
"1D": "range.tipOneDay",
|
|
4552
|
+
"5D": "range.tipFiveDays",
|
|
4553
|
+
"1M": "range.tipOneMonth",
|
|
4554
|
+
"3M": "range.tipThreeMonths",
|
|
4555
|
+
"6M": "range.tipSixMonths",
|
|
4556
|
+
YTD: "range.yearToDate",
|
|
4557
|
+
"1Y": "range.tipOneYear",
|
|
4558
|
+
"5Y": "range.tipFiveYears",
|
|
4559
|
+
All: "range.all"
|
|
4560
|
+
};
|
|
4561
|
+
var RANGE_INTERVAL_NAME = {
|
|
4562
|
+
t: "range.intervalTicks",
|
|
4563
|
+
s: "range.intervalSeconds",
|
|
4564
|
+
m: "range.intervalMinutes",
|
|
4565
|
+
h: "range.intervalHours",
|
|
4566
|
+
d: "range.intervalDays",
|
|
4567
|
+
w: "range.intervalWeeks",
|
|
4568
|
+
mo: "range.intervalMonths"
|
|
4569
|
+
};
|
|
4443
4570
|
function rangePresetTip(t, preset) {
|
|
4571
|
+
const tf = parseTimeframe(preset.tf);
|
|
4572
|
+
const timeframe2 = tf ? t(RANGE_INTERVAL_NAME[tf.unit], { count: tf.count }) : preset.tf;
|
|
4573
|
+
return t("range.tipIntervals", { range: t(RANGE_TIP_NAME[preset.key] ?? preset.label), timeframe: timeframe2 });
|
|
4574
|
+
}
|
|
4575
|
+
function rangePresetName(t, preset) {
|
|
4444
4576
|
return t("range.tip", { range: t(preset.label), timeframe: timeframeLabel(t, preset.tf) });
|
|
4445
4577
|
}
|
|
4446
4578
|
function frameRange(chart, series2, span, tf, nowSecs = Math.floor(Date.now() / 1e3)) {
|
|
@@ -5045,6 +5177,7 @@ function chartSettingsDefaults(theme) {
|
|
|
5045
5177
|
preMarketColor: theme["scale.sessionPreMarket"],
|
|
5046
5178
|
postMarketColor: theme["scale.sessionAfterHours"],
|
|
5047
5179
|
nightColor: theme["scale.sessionExtended"],
|
|
5180
|
+
electronicColor: theme["scale.sessionElectronic"],
|
|
5048
5181
|
precision: "default"
|
|
5049
5182
|
},
|
|
5050
5183
|
statusLine: {
|
|
@@ -5515,7 +5648,8 @@ var STATE_RANK = { pre: 0, after: 0, extended: 1 };
|
|
|
5515
5648
|
var SUBSESSION_STATE = {
|
|
5516
5649
|
premarket: "pre",
|
|
5517
5650
|
postmarket: "after",
|
|
5518
|
-
extended: "extended"
|
|
5651
|
+
extended: "extended",
|
|
5652
|
+
overnight: "extended"
|
|
5519
5653
|
};
|
|
5520
5654
|
function parseSessionModel(source3) {
|
|
5521
5655
|
const timezone2 = source3.timezone.trim();
|
|
@@ -5523,26 +5657,50 @@ function parseSessionModel(source3) {
|
|
|
5523
5657
|
const holidays = parseHolidays(source3.sessionHolidays);
|
|
5524
5658
|
if (!holidays) return null;
|
|
5525
5659
|
if (source3.session.trim() === "24x7") {
|
|
5526
|
-
return { timezone: timezone2, continuous: true, regular: { week: Array.from({ length: 7 }, () => [{ start: 0, end: MINUTES_PER_DAY }]), corrections: /* @__PURE__ */ new Map() }, extended: [], holidays };
|
|
5660
|
+
return { timezone: timezone2, continuous: true, electronic: false, regular: { week: Array.from({ length: 7 }, () => [{ start: 0, end: MINUTES_PER_DAY }]), corrections: /* @__PURE__ */ new Map() }, extended: [], holidays };
|
|
5527
5661
|
}
|
|
5528
5662
|
const regularSource = source3.subsessions?.find((s) => s.id === "regular");
|
|
5529
5663
|
const regular = regularSource ? parseSchedule(regularSource.session, regularSource.sessionCorrections ?? source3.corrections) : parseSchedule(source3.session, source3.corrections);
|
|
5530
5664
|
if (!regular) return null;
|
|
5665
|
+
const day = regularSource ? parseWeek(source3.session) : null;
|
|
5666
|
+
const electronic = day !== null && JSON.stringify(day) !== JSON.stringify(regular.week);
|
|
5531
5667
|
const extended = [];
|
|
5532
5668
|
for (const sub of source3.subsessions ?? []) {
|
|
5533
5669
|
const state = SUBSESSION_STATE[sub.id];
|
|
5534
5670
|
if (!state) continue;
|
|
5535
5671
|
const schedule = parseSchedule(sub.session, sub.sessionCorrections);
|
|
5536
5672
|
if (!schedule) return null;
|
|
5537
|
-
extended.push({ state, schedule });
|
|
5673
|
+
extended.push({ id: sub.id, state: electronic ? "extended" : state, schedule });
|
|
5674
|
+
}
|
|
5675
|
+
if (electronic && !extended.some((stretch) => stretch.id === "extended")) {
|
|
5676
|
+
const whole = parseSchedule(source3.session, source3.corrections);
|
|
5677
|
+
if (!whole) return null;
|
|
5678
|
+
extended.push({ id: "extended", state: "extended", schedule: whole });
|
|
5538
5679
|
}
|
|
5539
5680
|
extended.sort((a, b) => STATE_RANK[a.state] - STATE_RANK[b.state]);
|
|
5540
|
-
return { timezone: timezone2, continuous: false, regular, extended, holidays };
|
|
5681
|
+
return { timezone: timezone2, continuous: false, electronic, regular, extended, holidays };
|
|
5541
5682
|
}
|
|
5542
5683
|
var DEFAULT_SUBSESSION = "extended";
|
|
5543
5684
|
function hasExtendedHours(model) {
|
|
5544
5685
|
return model.extended.length > 0;
|
|
5545
5686
|
}
|
|
5687
|
+
var ELECTRONIC_OPTIONS = [
|
|
5688
|
+
{ hours: "extended", label: "settings.sessionElectronic", short: "chrome.sessionShortExtended" },
|
|
5689
|
+
{ hours: "regular", label: "settings.sessionRegularHours", short: "chrome.sessionShortRegular" }
|
|
5690
|
+
];
|
|
5691
|
+
var SPLIT_OPTIONS = [
|
|
5692
|
+
{ hours: "regular", label: "settings.sessionRegular", short: "chrome.sessionShortRegular" },
|
|
5693
|
+
{ hours: "extended", label: "settings.sessionExtended", short: "chrome.sessionShortExtended" }
|
|
5694
|
+
];
|
|
5695
|
+
var ALL_HOURS_OPTION = { hours: "allHours", label: "settings.sessionAllHours", short: "chrome.sessionShortAllHours" };
|
|
5696
|
+
function tradingHoursOptions(model) {
|
|
5697
|
+
if (!model || model.continuous || !hasExtendedHours(model)) return [];
|
|
5698
|
+
if (model.electronic) return ELECTRONIC_OPTIONS;
|
|
5699
|
+
return model.extended.some((stretch) => stretch.id === "overnight") ? [...SPLIT_OPTIONS, ALL_HOURS_OPTION] : SPLIT_OPTIONS;
|
|
5700
|
+
}
|
|
5701
|
+
function tradingHoursOption(options2, hours) {
|
|
5702
|
+
return options2.find((option) => option.hours === hours) ?? (hours === "allHours" ? options2.find((option) => option.hours === "extended") ?? null : null);
|
|
5703
|
+
}
|
|
5546
5704
|
function subsessionBarFilter(model, active) {
|
|
5547
5705
|
if (active !== "regular" || !hasExtendedHours(model)) return null;
|
|
5548
5706
|
return (epochSecs) => sessionStateAt(model, epochSecs) === "open";
|
|
@@ -5578,6 +5736,9 @@ function stateAtLocal(model, d, minute) {
|
|
|
5578
5736
|
for (const sub of model.extended) if (inSchedule(model, sub.schedule, d, minute)) return sub.state;
|
|
5579
5737
|
return "closed";
|
|
5580
5738
|
}
|
|
5739
|
+
function marketFacing(model, state) {
|
|
5740
|
+
return model.electronic && state === "extended" ? "open" : state;
|
|
5741
|
+
}
|
|
5581
5742
|
function localAt(model, epochSecs) {
|
|
5582
5743
|
const c = zoneClock(model.timezone, new Date(epochSecs * 1e3));
|
|
5583
5744
|
return { day: { year: c.year, month: c.month, day: c.day }, minute: c.hour * 60 + c.minute };
|
|
@@ -5586,6 +5747,28 @@ function sessionStateAt(model, epochSecs) {
|
|
|
5586
5747
|
const { day, minute } = localAt(model, epochSecs);
|
|
5587
5748
|
return stateAtLocal(model, day, minute);
|
|
5588
5749
|
}
|
|
5750
|
+
function marketStateAt(model, epochSecs) {
|
|
5751
|
+
return marketFacing(model, sessionStateAt(model, epochSecs));
|
|
5752
|
+
}
|
|
5753
|
+
function closedForHoliday(model, d) {
|
|
5754
|
+
const key = dateKey(d.year, d.month, d.day);
|
|
5755
|
+
if (!model.holidays.has(key) || model.regular.corrections.has(key)) return false;
|
|
5756
|
+
return !model.extended.some((stretch) => stretch.schedule.corrections.has(key));
|
|
5757
|
+
}
|
|
5758
|
+
function holidayAt(model, d, minute) {
|
|
5759
|
+
if (model.continuous || model.holidays.size === 0) return false;
|
|
5760
|
+
if (closedForHoliday(model, d)) return true;
|
|
5761
|
+
const schedules = [model.regular, ...model.extended.map((stretch) => stretch.schedule)];
|
|
5762
|
+
for (let k = -DAY_REACH_BACK; k <= DAY_REACH_FORWARD; k++) {
|
|
5763
|
+
const tradingDay = shiftDay(d, k);
|
|
5764
|
+
if (k === 0 || !closedForHoliday(model, tradingDay)) continue;
|
|
5765
|
+
const shift = k * MINUTES_PER_DAY;
|
|
5766
|
+
for (const schedule of schedules) {
|
|
5767
|
+
for (const seg of schedule.week[weekdayOf(tradingDay)] ?? []) if (minute >= seg.start + shift && minute < seg.end + shift) return true;
|
|
5768
|
+
}
|
|
5769
|
+
}
|
|
5770
|
+
return false;
|
|
5771
|
+
}
|
|
5589
5772
|
function localToEpoch(model, d, minute) {
|
|
5590
5773
|
const wall2 = Date.UTC(d.year, d.month - 1, d.day) + minute * 6e4;
|
|
5591
5774
|
const first = wall2 - tzOffsetMinutes(model.timezone, new Date(wall2)) * 6e4;
|
|
@@ -5594,8 +5777,11 @@ function localToEpoch(model, d, minute) {
|
|
|
5594
5777
|
}
|
|
5595
5778
|
var NEXT_CHANGE_HORIZON_DAYS = 8;
|
|
5596
5779
|
function nextSessionChange(model, epochSecs) {
|
|
5780
|
+
return nextChange(model, epochSecs, (at2) => sessionStateAt(model, at2));
|
|
5781
|
+
}
|
|
5782
|
+
function nextChange(model, epochSecs, classify) {
|
|
5597
5783
|
if (model.continuous) return null;
|
|
5598
|
-
const from =
|
|
5784
|
+
const from = classify(epochSecs);
|
|
5599
5785
|
const { day } = localAt(model, epochSecs);
|
|
5600
5786
|
const edges = /* @__PURE__ */ new Set();
|
|
5601
5787
|
const schedules = [model.regular, ...model.extended.map((e) => e.schedule)];
|
|
@@ -5611,7 +5797,7 @@ function nextSessionChange(model, epochSecs) {
|
|
|
5611
5797
|
const horizon = epochSecs + NEXT_CHANGE_HORIZON_DAYS * 86400;
|
|
5612
5798
|
for (const at2 of [...edges].sort((a, b) => a - b)) {
|
|
5613
5799
|
if (at2 <= epochSecs || at2 > horizon) continue;
|
|
5614
|
-
const state =
|
|
5800
|
+
const state = classify(at2);
|
|
5615
5801
|
if (state !== from) return { atSecs: at2, state };
|
|
5616
5802
|
}
|
|
5617
5803
|
return null;
|
|
@@ -5634,7 +5820,7 @@ function sessionTimeline(model, epochSecs, tag) {
|
|
|
5634
5820
|
for (let i = 0; i + 1 < sorted.length; i++) {
|
|
5635
5821
|
const start = sorted[i];
|
|
5636
5822
|
const end = sorted[i + 1];
|
|
5637
|
-
const state = stateAtLocal(model, day, start);
|
|
5823
|
+
const state = marketFacing(model, stateAtLocal(model, day, start));
|
|
5638
5824
|
const last = segments2[segments2.length - 1];
|
|
5639
5825
|
if (last && last.state === state) segments2[segments2.length - 1] = { start: last.start, end, state };
|
|
5640
5826
|
else segments2.push({ start, end, state });
|
|
@@ -5646,10 +5832,47 @@ function sessionTimeline(model, epochSecs, tag) {
|
|
|
5646
5832
|
weekdayFormatters.set(cacheKey, weekday);
|
|
5647
5833
|
}
|
|
5648
5834
|
const dayLabel = weekday.format(new Date(epochSecs * 1e3)).toUpperCase();
|
|
5649
|
-
|
|
5835
|
+
const before = marketFacing(model, stateAtLocal(model, shiftDay(day, -1), MINUTES_PER_DAY - 1));
|
|
5836
|
+
const after = marketFacing(model, stateAtLocal(model, shiftDay(day, 1), 0));
|
|
5837
|
+
return { segments: segments2, before, after, nowMins: minute, dayLabel, timezone: model.timezone };
|
|
5838
|
+
}
|
|
5839
|
+
function extendedIsOvernight(model) {
|
|
5840
|
+
if (model.electronic) return false;
|
|
5841
|
+
const ids = new Set(model.extended.map((stretch) => stretch.id));
|
|
5842
|
+
return ids.has("overnight") || ids.has("premarket") && ids.has("postmarket");
|
|
5843
|
+
}
|
|
5844
|
+
function phaseOf(model, state, holiday) {
|
|
5845
|
+
switch (state) {
|
|
5846
|
+
case "open":
|
|
5847
|
+
return "open";
|
|
5848
|
+
case "pre":
|
|
5849
|
+
return "pre";
|
|
5850
|
+
case "after":
|
|
5851
|
+
return "post";
|
|
5852
|
+
case "extended":
|
|
5853
|
+
return extendedIsOvernight(model) ? "overnight" : "extended";
|
|
5854
|
+
case "closed":
|
|
5855
|
+
return holiday ? "holiday" : "closed";
|
|
5856
|
+
}
|
|
5857
|
+
}
|
|
5858
|
+
function phaseAt(model, atSecs, state) {
|
|
5859
|
+
if (state !== "closed") return phaseOf(model, state, false);
|
|
5860
|
+
const { day, minute } = localAt(model, atSecs);
|
|
5861
|
+
return phaseOf(model, state, holidayAt(model, day, minute));
|
|
5650
5862
|
}
|
|
5651
5863
|
function marketStatus(model, dataStatus, nowSecs) {
|
|
5652
|
-
|
|
5864
|
+
const { day, minute } = localAt(model, nowSecs);
|
|
5865
|
+
const state = marketFacing(model, stateAtLocal(model, day, minute));
|
|
5866
|
+
const holiday = state === "closed" && holidayAt(model, day, minute);
|
|
5867
|
+
const change = nextChange(model, nowSecs, (at2) => marketStateAt(model, at2));
|
|
5868
|
+
return {
|
|
5869
|
+
state,
|
|
5870
|
+
phase: phaseOf(model, state, holiday),
|
|
5871
|
+
dataStatus,
|
|
5872
|
+
continuous: model.continuous,
|
|
5873
|
+
holiday,
|
|
5874
|
+
next: change ? { atSecs: change.atSecs, state: change.state, phase: phaseAt(model, change.atSecs, change.state) } : null
|
|
5875
|
+
};
|
|
5653
5876
|
}
|
|
5654
5877
|
function marketStatusFor(symbol, nowSecs) {
|
|
5655
5878
|
const model = parseSessionModel(symbol);
|
|
@@ -5662,10 +5885,60 @@ var SESSION_STATE_TITLE = {
|
|
|
5662
5885
|
after: "session.after",
|
|
5663
5886
|
closed: "session.closed"
|
|
5664
5887
|
};
|
|
5888
|
+
var PHASE_TITLE = {
|
|
5889
|
+
open: "session.open",
|
|
5890
|
+
pre: "session.pre",
|
|
5891
|
+
post: "session.after",
|
|
5892
|
+
overnight: "status.overnightTitle",
|
|
5893
|
+
extended: "session.extended",
|
|
5894
|
+
closed: "session.closed",
|
|
5895
|
+
holiday: "status.holidayTitle"
|
|
5896
|
+
};
|
|
5897
|
+
var PHASE_SENTENCE = {
|
|
5898
|
+
open: "status.openText",
|
|
5899
|
+
pre: "status.preText",
|
|
5900
|
+
post: "status.postText",
|
|
5901
|
+
overnight: "status.overnightText",
|
|
5902
|
+
extended: "status.extended",
|
|
5903
|
+
closed: "status.closedText",
|
|
5904
|
+
holiday: "status.holidayText"
|
|
5905
|
+
};
|
|
5665
5906
|
function marketStatusTitle(t, status2) {
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5907
|
+
return t(PHASE_TITLE[status2.phase]);
|
|
5908
|
+
}
|
|
5909
|
+
function marketStatusSentence(t, status2) {
|
|
5910
|
+
return t(PHASE_SENTENCE[status2.phase]);
|
|
5911
|
+
}
|
|
5912
|
+
function marketStatusCountdown(t, status2, nowSecs) {
|
|
5913
|
+
const next = status2.next;
|
|
5914
|
+
if (status2.continuous || !next) return null;
|
|
5915
|
+
const until = formatDuration(t, next.atSecs - nowSecs);
|
|
5916
|
+
const closed = status2.phase === "closed" || status2.phase === "holiday";
|
|
5917
|
+
switch (next.phase) {
|
|
5918
|
+
case "closed":
|
|
5919
|
+
case "holiday":
|
|
5920
|
+
return t("status.closesIn", { until });
|
|
5921
|
+
case "pre":
|
|
5922
|
+
return t(closed ? "status.opensPreMarketIn" : "status.preMarketIn", { until });
|
|
5923
|
+
case "open":
|
|
5924
|
+
return t(closed ? "status.opensIn" : "status.opensFullyIn", { until });
|
|
5925
|
+
case "post":
|
|
5926
|
+
return t(closed ? "status.opensIn" : "status.postMarketIn", { until });
|
|
5927
|
+
case "overnight":
|
|
5928
|
+
return t(closed ? "status.opensIn" : "status.overnightIn", { until });
|
|
5929
|
+
case "extended":
|
|
5930
|
+
return t(closed ? "status.opensIn" : "status.extendedIn", { until });
|
|
5931
|
+
}
|
|
5932
|
+
}
|
|
5933
|
+
function marketStatusText(t, status2, nowSecs) {
|
|
5934
|
+
const sentence = marketStatusSentence(t, status2);
|
|
5935
|
+
const countdown = marketStatusCountdown(t, status2, nowSecs);
|
|
5936
|
+
return countdown ? t("status.textPair", { sentence, countdown }) : sentence;
|
|
5937
|
+
}
|
|
5938
|
+
function dataStatusNotice(t, dataStatus) {
|
|
5939
|
+
if (dataStatus === "delayed_streaming") return { title: t("status.delayedTitle"), text: t("status.delayedText") };
|
|
5940
|
+
if (dataStatus === "endofday") return { title: t("status.endOfDayTitle"), text: t("status.endOfDay") };
|
|
5941
|
+
return null;
|
|
5669
5942
|
}
|
|
5670
5943
|
function formatDuration(t, secs) {
|
|
5671
5944
|
const mins = Math.max(1, Math.round(secs / 60));
|
|
@@ -5683,30 +5956,6 @@ function formatDuration(t, secs) {
|
|
|
5683
5956
|
}
|
|
5684
5957
|
return t("status.durationMinutes", { count: m });
|
|
5685
5958
|
}
|
|
5686
|
-
function marketStatusText(t, status2, nowSecs) {
|
|
5687
|
-
if (status2.dataStatus === "endofday") return t("status.endOfDay");
|
|
5688
|
-
const session2 = sessionSentence(t, status2, nowSecs);
|
|
5689
|
-
return status2.dataStatus === "delayed_streaming" ? t("status.delayedPair", { status: session2, delay: t("status.delayed") }) : session2;
|
|
5690
|
-
}
|
|
5691
|
-
function sessionSentence(t, status2, nowSecs) {
|
|
5692
|
-
if (status2.continuous) return t("status.continuous");
|
|
5693
|
-
const next = status2.next;
|
|
5694
|
-
const until = next ? formatDuration(t, next.atSecs - nowSecs) : null;
|
|
5695
|
-
switch (status2.state) {
|
|
5696
|
-
case "open":
|
|
5697
|
-
return until ? t("status.openCloses", { until }) : t("status.open");
|
|
5698
|
-
case "extended":
|
|
5699
|
-
if (!until || !next) return t("status.extended");
|
|
5700
|
-
return next.state === "open" ? t("status.extendedRegular", { until }) : t("status.extendedCloses", { until });
|
|
5701
|
-
case "pre":
|
|
5702
|
-
return until ? t("status.preRegular", { until }) : t("status.pre");
|
|
5703
|
-
case "after":
|
|
5704
|
-
return until ? t("status.afterEnds", { until }) : t("status.after");
|
|
5705
|
-
case "closed":
|
|
5706
|
-
if (!until || !next) return t("status.closed");
|
|
5707
|
-
return next.state === "pre" ? t("status.closedPre", { until }) : t("status.closedOpens", { until });
|
|
5708
|
-
}
|
|
5709
|
-
}
|
|
5710
5959
|
function exchangeTimezoneText(t, timezone2, at2 = /* @__PURE__ */ new Date()) {
|
|
5711
5960
|
return t("status.exchangeTimezone", { zone: timezoneLabel(timezone2, at2) });
|
|
5712
5961
|
}
|
|
@@ -5716,7 +5965,7 @@ var SESSION_LABEL = {
|
|
|
5716
5965
|
pre: "Pre-market",
|
|
5717
5966
|
open: "Market open",
|
|
5718
5967
|
extended: "Extended hours",
|
|
5719
|
-
after: "
|
|
5968
|
+
after: "Post-market",
|
|
5720
5969
|
closed: "Market closed"
|
|
5721
5970
|
};
|
|
5722
5971
|
var SESSION_DOT = {
|
|
@@ -5762,8 +6011,13 @@ function sessionBreakTimes(model, times) {
|
|
|
5762
6011
|
return breaks;
|
|
5763
6012
|
}
|
|
5764
6013
|
function createSessionBands(chart, series2, enabled, model, intraday, theme, look) {
|
|
5765
|
-
const shadeOf = (state) => {
|
|
5766
|
-
if (state === "closed"
|
|
6014
|
+
const shadeOf = (state, electronic) => {
|
|
6015
|
+
if (state === "closed") return theme()[BAND_ROLE.closed];
|
|
6016
|
+
if (electronic) {
|
|
6017
|
+
const chosen2 = look?.().electronic;
|
|
6018
|
+
return chosen2 === void 0 ? theme()["scale.sessionElectronic"] : chosen2;
|
|
6019
|
+
}
|
|
6020
|
+
if (!look) return theme()[BAND_ROLE[state]];
|
|
5767
6021
|
return look()[state];
|
|
5768
6022
|
};
|
|
5769
6023
|
const renderer = {
|
|
@@ -5796,7 +6050,7 @@ function createSessionBands(chart, series2, enabled, model, intraday, theme, loo
|
|
|
5796
6050
|
runStart = null;
|
|
5797
6051
|
return;
|
|
5798
6052
|
}
|
|
5799
|
-
const fill = shadeOf(runState);
|
|
6053
|
+
const fill = shadeOf(runState, m.electronic);
|
|
5800
6054
|
const x1 = ts.timeToCoordinate(runStart);
|
|
5801
6055
|
const x2 = ts.timeToCoordinate(endTime);
|
|
5802
6056
|
if (fill === null || x1 == null && x2 == null) {
|
|
@@ -6286,16 +6540,16 @@ function attachSession(deps) {
|
|
|
6286
6540
|
series2.attachPrimitive(bands);
|
|
6287
6541
|
const layer = {
|
|
6288
6542
|
model: () => model,
|
|
6289
|
-
state: () => model ? sessionStateAt(model, Math.floor(Date.now() / 1e3)) : null,
|
|
6290
6543
|
status(nowSecs) {
|
|
6291
6544
|
const status2 = deps.dataStatus();
|
|
6292
6545
|
if (!model || !status2) return null;
|
|
6293
6546
|
return marketStatus(model, status2, nowSecs ?? Math.floor(Date.now() / 1e3));
|
|
6294
6547
|
},
|
|
6295
6548
|
extended: () => model ? hasExtendedHours(model) : false,
|
|
6549
|
+
options: () => tradingHoursOptions(model),
|
|
6296
6550
|
subsession: () => deps.subsession(),
|
|
6297
6551
|
setSubsession(next) {
|
|
6298
|
-
if (next === deps.
|
|
6552
|
+
if (next === deps.hours() || next === "extended" && !layer.extended()) return;
|
|
6299
6553
|
deps.setSubsession(next);
|
|
6300
6554
|
bands?.refresh();
|
|
6301
6555
|
},
|
|
@@ -8387,11 +8641,16 @@ function reglyph(element, icons, mark, options2 = {}) {
|
|
|
8387
8641
|
}
|
|
8388
8642
|
function name(element, label3) {
|
|
8389
8643
|
element.setAttribute("aria-label", label3);
|
|
8390
|
-
|
|
8644
|
+
}
|
|
8645
|
+
function tip(element, words) {
|
|
8646
|
+
if (words === null) element.removeAttribute("data-qc-tip");
|
|
8647
|
+
else element.dataset.qcTip = words;
|
|
8391
8648
|
}
|
|
8392
8649
|
function button2(options2) {
|
|
8393
8650
|
const element = h("button", { type: "button", class: `qc-button${options2.className ? ` ${options2.className}` : ""}` });
|
|
8394
8651
|
name(element, options2.label);
|
|
8652
|
+
if (options2.tip !== void 0) tip(element, options2.tip);
|
|
8653
|
+
if (options2.noTip) element.setAttribute("data-no-tip", "");
|
|
8395
8654
|
if (options2.icon) element.appendChild(options2.icon);
|
|
8396
8655
|
if (options2.text !== void 0) element.appendChild(h("span", { class: "qc-button-text" }, options2.text));
|
|
8397
8656
|
if (options2.pressed !== void 0) element.setAttribute("aria-pressed", String(options2.pressed));
|
|
@@ -8542,6 +8801,10 @@ function checkbox(label3, value, onChange) {
|
|
|
8542
8801
|
input.addEventListener("change", () => onChange(input.checked));
|
|
8543
8802
|
return input;
|
|
8544
8803
|
}
|
|
8804
|
+
var stepper = (b) => {
|
|
8805
|
+
b.setAttribute("data-no-tip", "");
|
|
8806
|
+
return b;
|
|
8807
|
+
};
|
|
8545
8808
|
function listButton(icons, label3, text2, width, popup) {
|
|
8546
8809
|
const b = el("button", {
|
|
8547
8810
|
type: "button",
|
|
@@ -8550,6 +8813,8 @@ function listButton(icons, label3, text2, width, popup) {
|
|
|
8550
8813
|
"aria-haspopup": popup,
|
|
8551
8814
|
"aria-expanded": "false",
|
|
8552
8815
|
"data-width": width,
|
|
8816
|
+
// A field that shows its value raises no name bubble.
|
|
8817
|
+
"data-no-tip": "",
|
|
8553
8818
|
...popup === "listbox" ? { role: "combobox" } : {}
|
|
8554
8819
|
});
|
|
8555
8820
|
b.append(el("span", { class: "qc-drawing-select-value", text: text2 }), selectChevron(icons));
|
|
@@ -8676,8 +8941,8 @@ function numberInput(t, icons, props) {
|
|
|
8676
8941
|
const steppers = el(
|
|
8677
8942
|
"span",
|
|
8678
8943
|
{ class: "qc-drawing-steppers" },
|
|
8679
|
-
button({ class: "qc-drawing-stepper", label: t("drawing.increase"), icon: icons.icon("chevronDown18", 18), onClick: () => stepBy(1) }),
|
|
8680
|
-
button({ class: "qc-drawing-stepper", label: t("drawing.decrease"), icon: icons.icon("chevronDown18", 18), onClick: () => stepBy(-1) })
|
|
8944
|
+
stepper(button({ class: "qc-drawing-stepper", label: t("drawing.increase"), icon: icons.icon("chevronDown18", 18), onClick: () => stepBy(1) })),
|
|
8945
|
+
stepper(button({ class: "qc-drawing-stepper", label: t("drawing.decrease"), icon: icons.icon("chevronDown18", 18), onClick: () => stepBy(-1) }))
|
|
8681
8946
|
);
|
|
8682
8947
|
steppers.firstElementChild?.setAttribute("data-up", "true");
|
|
8683
8948
|
for (const b of steppers.querySelectorAll("button")) b.tabIndex = -1;
|
|
@@ -9201,7 +9466,7 @@ function mountGlyphPicker(input) {
|
|
|
9201
9466
|
const renderStrip = () => {
|
|
9202
9467
|
strip.replaceChildren();
|
|
9203
9468
|
for (const c of categories()) {
|
|
9204
|
-
const b = el("button", { type: "button", class: "qc-drawing-glyph-tab", role: "tab", "aria-label": label3(c),
|
|
9469
|
+
const b = el("button", { type: "button", class: "qc-drawing-glyph-tab", role: "tab", "aria-label": label3(c), "aria-selected": String(c.id === activeCategory), "aria-controls": `${deps.idBase}-${c.id}` });
|
|
9205
9470
|
b.append(face(c.face));
|
|
9206
9471
|
b.addEventListener("click", () => jumpTo(c.id));
|
|
9207
9472
|
strip.appendChild(b);
|
|
@@ -9462,7 +9727,6 @@ function mountDrawingToolbar(deps) {
|
|
|
9462
9727
|
star2.replaceChildren(deps.icons.icon(now ? "starFilled" : "star", 18));
|
|
9463
9728
|
star2.setAttribute("aria-pressed", String(now));
|
|
9464
9729
|
star2.setAttribute("aria-label", t(now ? "drawing.favRemove" : "drawing.favAdd", { tool: name2 }));
|
|
9465
|
-
star2.title = star2.getAttribute("aria-label") ?? "";
|
|
9466
9730
|
}
|
|
9467
9731
|
});
|
|
9468
9732
|
star2.hidden = !shown2("chart.drawings.favorite");
|
|
@@ -9571,15 +9835,26 @@ function mountDrawingToolbar(deps) {
|
|
|
9571
9835
|
openFlyout(removeArrow, menu2(t("drawing.removeMenu"), ...items2, divider("menu"), policy));
|
|
9572
9836
|
});
|
|
9573
9837
|
column.append(cell2(removeFace, removeArrow));
|
|
9574
|
-
const favorites = button({ class: "qc-button qc-drawing-toolbar-mode", label: t("drawing.favToolsBar"),
|
|
9838
|
+
const favorites = button({ class: "qc-button qc-drawing-toolbar-mode", label: t("drawing.favToolsBar"), tip: t("drawing.favTools"), onClick: () => deps.run("chart.drawings.favoritesBar", !deps.state().favorites.visible) });
|
|
9575
9839
|
column.append(el("div", { class: "qc-drawing-toolbar-end" }, cell2(favorites, null)));
|
|
9576
9840
|
const unrove = rovingFocus(toolbar, () => [...column.querySelectorAll("button")].filter((b) => !b.closest("[hidden]")), "vertical");
|
|
9841
|
+
const GROUP_TIPS = {
|
|
9842
|
+
trend: "drawing.groupTrend",
|
|
9843
|
+
"fib-gann": "drawing.tipFibGann",
|
|
9844
|
+
patterns: "drawing.groupPatterns",
|
|
9845
|
+
forecast: "drawing.tipForecast",
|
|
9846
|
+
shapes: "drawing.tipShapes",
|
|
9847
|
+
annotation: "drawing.tipAnnotations",
|
|
9848
|
+
glyphs: "drawing.kindIcons"
|
|
9849
|
+
};
|
|
9850
|
+
const groupTip = (group) => t(GROUP_TIPS[group.id] ?? group.label);
|
|
9577
9851
|
const setActive = (b, active) => {
|
|
9578
9852
|
b.dataset.qcActive = String(active);
|
|
9579
9853
|
};
|
|
9580
|
-
const relabelButton = (b, label3,
|
|
9854
|
+
const relabelButton = (b, label3, words = null) => {
|
|
9581
9855
|
b.setAttribute("aria-label", label3);
|
|
9582
|
-
b.
|
|
9856
|
+
if (words === null || words === label3) b.removeAttribute("data-qc-tip");
|
|
9857
|
+
else b.dataset.qcTip = words;
|
|
9583
9858
|
};
|
|
9584
9859
|
const gate = (b, command2, refused = false) => {
|
|
9585
9860
|
b.disabled = refused || !deps.available(command2);
|
|
@@ -9588,6 +9863,7 @@ function mountDrawingToolbar(deps) {
|
|
|
9588
9863
|
const render = () => {
|
|
9589
9864
|
const s = deps.state();
|
|
9590
9865
|
cursorFace.replaceChildren(deps.icons.icon(s.activeTool === "eraser" ? "eraser" : CURSOR_ICON[s.cursor]));
|
|
9866
|
+
relabelButton(cursorFace, t("drawing.cursor"), t(s.activeTool === "eraser" ? TRANSIENT_LABELS.eraser : CURSOR_LABELS[s.cursor]));
|
|
9591
9867
|
setActive(cursorFace, cursorButtonArmed(s.activeTool));
|
|
9592
9868
|
gate(cursorFace, "chart.drawings.arm");
|
|
9593
9869
|
gate(cursorArrow, "chart.drawings.cursor");
|
|
@@ -9599,7 +9875,7 @@ function mountDrawingToolbar(deps) {
|
|
|
9599
9875
|
const faceTool = activeGroup === group.id && s.activeTool && toolShown(s.activeTool) ? s.activeTool : drawingToolbarFaceOf(drawn2, s.drawingToolbarTools);
|
|
9600
9876
|
entry.face.replaceChildren(...[group.id === "glyphs" ? deps.icons.icon("groupGlyphs") : faceTool ? deps.icons.tool(faceTool) : null].filter((face) => face !== null));
|
|
9601
9877
|
const faceName = faceTool && group.id !== "glyphs" ? toolName(t, faceTool, faceTool) : t(group.label);
|
|
9602
|
-
relabelButton(entry.face, faceName);
|
|
9878
|
+
relabelButton(entry.face, faceName, group.id === "glyphs" ? groupTip(group) : null);
|
|
9603
9879
|
gate(entry.face, "chart.drawings.arm", !!faceTool && group.id !== "glyphs" && !deps.toolAllowed(faceTool));
|
|
9604
9880
|
gate(entry.arrow, "chart.drawings.arm");
|
|
9605
9881
|
if (drawn2.sections.length === 0) entry.face.hidden = entry.arrow.hidden = true;
|
|
@@ -9629,7 +9905,7 @@ function mountDrawingToolbar(deps) {
|
|
|
9629
9905
|
const mark = hideMark(s, s.hide.mode, s.hide.on);
|
|
9630
9906
|
if (mark) eyeFace.replaceChildren(mark);
|
|
9631
9907
|
else eyeFace.replaceChildren();
|
|
9632
|
-
relabelButton(eyeFace, hideLabel(s, s.hide.mode, s.hide.on ? "show" : "hide"));
|
|
9908
|
+
relabelButton(eyeFace, hideLabel(s, s.hide.mode, s.hide.on ? "show" : "hide"), s.hide.mode === "drawings" ? t(s.hide.on ? "drawing.tipShowAll" : "drawing.tipHideAll") : null);
|
|
9633
9909
|
setActive(eyeFace, s.hide.on);
|
|
9634
9910
|
eyeFace.setAttribute("aria-pressed", String(s.hide.on));
|
|
9635
9911
|
gate(eyeFace, "chart.drawings.hide");
|
|
@@ -9639,7 +9915,7 @@ function mountDrawingToolbar(deps) {
|
|
|
9639
9915
|
syncButton = button({ class: "qc-button qc-drawing-toolbar-button", label: t("drawing.syncLabel"), icon: deps.icons.icon("sync"), onClick: () => deps.run("chart.drawings.sync", !deps.state().sync) });
|
|
9640
9916
|
syncCell.appendChild(syncButton);
|
|
9641
9917
|
}
|
|
9642
|
-
syncButton.
|
|
9918
|
+
syncButton.dataset.qcTip = t(s.sync ? "drawing.syncOnHelp" : "drawing.syncOffHelp");
|
|
9643
9919
|
syncButton.setAttribute("aria-pressed", String(s.sync));
|
|
9644
9920
|
setActive(syncButton, s.sync);
|
|
9645
9921
|
gate(syncButton, "chart.drawings.sync");
|
|
@@ -9647,12 +9923,11 @@ function mountDrawingToolbar(deps) {
|
|
|
9647
9923
|
syncButton.remove();
|
|
9648
9924
|
syncButton = null;
|
|
9649
9925
|
}
|
|
9650
|
-
const removable = removableDrawings(s.counts, s.removeLocked);
|
|
9651
|
-
removeFace.title = removable > 0 ? t("drawing.removeItems", { items: t("drawing.countDrawings", { count: removable }) }) : t("drawing.removeDrawings");
|
|
9652
9926
|
gate(removeFace, "chart.drawings.removeAll");
|
|
9653
9927
|
removeArrow.hidden = !shown2("chart.drawings.removeAll") && !shown2("chart.indicators.removeAll") && !shown2("chart.drawings.removeLockedPolicy");
|
|
9654
9928
|
favorites.replaceChildren(deps.icons.icon("favoritesBar"));
|
|
9655
9929
|
favorites.setAttribute("aria-pressed", String(s.favorites.visible));
|
|
9930
|
+
relabelButton(favorites, t("drawing.favToolsBar"), t(s.favorites.visible ? "drawing.tipHideFavorites" : "drawing.tipShowFavorites"));
|
|
9656
9931
|
setActive(favorites, s.favorites.visible);
|
|
9657
9932
|
gate(favorites, "chart.drawings.favoritesBar");
|
|
9658
9933
|
for (const box2 of column.querySelectorAll(".qc-drawing-cell")) {
|
|
@@ -9663,18 +9938,16 @@ function mountDrawingToolbar(deps) {
|
|
|
9663
9938
|
};
|
|
9664
9939
|
const relabel = () => {
|
|
9665
9940
|
toolbar.setAttribute("aria-label", t("drawing.toolbar"));
|
|
9666
|
-
relabelButton(
|
|
9667
|
-
relabelButton(
|
|
9668
|
-
for (const group of groups) relabelButton(groupFaces.get(group.id).arrow, t("drawing.groupMenu", { group: t(group.label) }));
|
|
9941
|
+
relabelButton(cursorArrow, t("drawing.cursorMenu"), t("drawing.tipCursors"));
|
|
9942
|
+
for (const group of groups) relabelButton(groupFaces.get(group.id).arrow, t("drawing.groupMenu", { group: t(group.label) }), groupTip(group));
|
|
9669
9943
|
relabelButton(measure2, t(TRANSIENT_LABELS.measure));
|
|
9670
9944
|
relabelButton(zoom, t(TRANSIENT_LABELS.zoom));
|
|
9671
|
-
relabelButton(magnetFace, t("drawing.magnet"));
|
|
9672
|
-
relabelButton(magnetArrow, t("drawing.magnetMenu"));
|
|
9673
|
-
relabelButton(stay, t("drawing.stayInDrawingMode"));
|
|
9674
|
-
relabelButton(eyeArrow, t("drawing.hideMenu"));
|
|
9675
|
-
relabelButton(removeFace, t("drawing.removeDrawings"));
|
|
9676
|
-
relabelButton(removeArrow, t("drawing.removeMenu"));
|
|
9677
|
-
relabelButton(favorites, t("drawing.favToolsBar"), t("drawing.favTools"));
|
|
9945
|
+
relabelButton(magnetFace, t("drawing.magnet"), t("drawing.tipMagnet"));
|
|
9946
|
+
relabelButton(magnetArrow, t("drawing.magnetMenu"), t("drawing.tipMagnets"));
|
|
9947
|
+
relabelButton(stay, t("drawing.stayInDrawingMode"), t("drawing.tipKeepDrawing"));
|
|
9948
|
+
relabelButton(eyeArrow, t("drawing.hideMenu"), t("drawing.tipHideOptions"));
|
|
9949
|
+
relabelButton(removeFace, t("drawing.removeDrawings"), t("drawing.tipRemoveObjects"));
|
|
9950
|
+
relabelButton(removeArrow, t("drawing.removeMenu"), t("drawing.tipRemoveOptions"));
|
|
9678
9951
|
if (syncButton) relabelButton(syncButton, t("drawing.syncLabel"));
|
|
9679
9952
|
render();
|
|
9680
9953
|
};
|
|
@@ -9688,7 +9961,7 @@ function mountDrawingToolbar(deps) {
|
|
|
9688
9961
|
render();
|
|
9689
9962
|
};
|
|
9690
9963
|
mount(deps.container === void 0 ? deps.chrome : deps.container);
|
|
9691
|
-
|
|
9964
|
+
relabel();
|
|
9692
9965
|
return {
|
|
9693
9966
|
mount,
|
|
9694
9967
|
render,
|
|
@@ -9708,7 +9981,7 @@ function mountFavoritesBar(deps) {
|
|
|
9708
9981
|
const { t } = deps;
|
|
9709
9982
|
const bar = el("div", { class: "qc-overlay qc-drawing-favorites", role: "toolbar", "aria-label": t("drawing.favToolsBar"), "data-role": "drawing-favorites" });
|
|
9710
9983
|
ownPointer(bar);
|
|
9711
|
-
const grip = button({ class: "qc-drawing-grip", label: t("drawing.moveFavoritesToolbar"),
|
|
9984
|
+
const grip = button({ class: "qc-drawing-grip", label: t("drawing.moveFavoritesToolbar"), tip: t("drawing.moveToolbar"), icon: deps.icons.icon("grip", 12) });
|
|
9712
9985
|
const tools2 = el("div", { class: "qc-drawing-favorites-tools" });
|
|
9713
9986
|
bar.append(grip, tools2);
|
|
9714
9987
|
const place = () => {
|
|
@@ -10109,8 +10382,8 @@ var SMALL_EYE = eye(13, 10, 9.55, 7.06, 1.1, 3.6);
|
|
|
10109
10382
|
var SMALL_EYE_CENTRED = eye(14, 14, 9.55, 7.06, 1.1, 3.6);
|
|
10110
10383
|
var LARGE_EYE = eye(14, 14, 10.55, 8, 1.1, 4);
|
|
10111
10384
|
var LEGEND_EYE = eye(9, 9.5, 7.95, 5.5, 1.45, 2.5);
|
|
10112
|
-
function pencil(
|
|
10113
|
-
const at2 = (u, v) => [
|
|
10385
|
+
function pencil(tip2, length, half, end) {
|
|
10386
|
+
const at2 = (u, v) => [tip2[0] + (u + v) / Math.SQRT2, tip2[1] + (v - u) / Math.SQRT2];
|
|
10114
10387
|
const inner = half - 1;
|
|
10115
10388
|
const point = half + 1.1;
|
|
10116
10389
|
const ferrule = length - 3.8;
|
|
@@ -10170,8 +10443,17 @@ var ICONS = {
|
|
|
10170
10443
|
viewBox: "0 0 120 120",
|
|
10171
10444
|
body: '<path fill="currentColor" d="M113 2.5A7 7 0 0 1 120 9.5L120 71.5A6 6 0 0 1 114 77.5L83 77.5A3 3 0 0 1 80 74.5L80 42.5A4 4 0 0 1 84 38.5L110 38.5A4 4 0 0 0 114 34.5L114 12.5A4 4 0 0 0 110 8.5L10 8.5A4 4 0 0 0 6 12.5L6 34.5A4 4 0 0 0 10 38.5L36 38.5A4 4 0 0 1 40 42.5L40 74.5A3 3 0 0 1 37 77.5L6 77.5A6 6 0 0 1 0 71.5L0 9.5A7 7 0 0 1 7 2.5Z"/><path fill="currentColor" d="M40 77.5H80V110.5A7 7 0 0 1 73 117.5H47A7 7 0 0 1 40 110.5Z"/>'
|
|
10172
10445
|
},
|
|
10173
|
-
/** The
|
|
10174
|
-
|
|
10446
|
+
/** The status marks, on their native 18 grid, each drawn in its kind's ink over the tint circle the
|
|
10447
|
+
* stylesheet gives the badge it stands in: the open market's dot, the pre-market sunrise, the
|
|
10448
|
+
* moon post-market, overnight and extended hours wear, the closed market's bar, the holiday's
|
|
10449
|
+
* snowflake, the delayed data's letter and the end-of-day data's hourglass. */
|
|
10450
|
+
marketStatus: { viewBox: "0 0 18 18", body: '<path fill="currentColor" d="M9 5a4 4 0 1 1 0 8 4 4 0 0 1 0-8"/>' },
|
|
10451
|
+
marketPreMarket: { viewBox: "0 0 18 18", body: '<path fill="currentColor" d="M9 7.2a3.48 3.48 0 0 1 3.22 4.8 7 7 0 0 0-6.44 0A3.47 3.47 0 0 1 9 7.2M4.4 8.59l-.33 1.24L2 9.27l.33-1.24zm11.6.68-2.06.56-.34-1.24 2.07-.56zM7.55 5.94l-1.17.55-.9-1.94L6.64 4zm4.97-1.4-.9 1.94-1.17-.54.9-1.94z"/>' },
|
|
10452
|
+
marketAfterHours: { viewBox: "0 0 18 18", body: '<path fill="currentColor" d="M12.57 5.5h-.07a3.5 3.5 0 1 0 .07 7A4.98 4.98 0 0 1 4 9a5 5 0 0 1 8.57-3.5"/>' },
|
|
10453
|
+
marketClosed: { viewBox: "0 0 18 18", body: '<path fill="currentColor" d="M12 7a2 2 0 1 1 0 4H6a2 2 0 1 1 0-4z"/>' },
|
|
10454
|
+
marketHoliday: { viewBox: "0 0 18 18", body: '<path fill="currentColor" d="M9 3c.78 0 1.36.71 1.2 1.47l-.74 3.74 2.86-2.52a1.23 1.23 0 1 1 1.2 2.09L9.93 9l3.6 1.22a1.23 1.23 0 1 1-1.2 2.09L9.46 9.79l.75 3.74a1.23 1.23 0 1 1-2.41 0l.74-3.74-2.86 2.52a1.23 1.23 0 1 1-1.2-2.09L8.08 9l-3.6-1.22a1.23 1.23 0 1 1 1.2-2.09l2.86 2.52-.74-3.74A1.23 1.23 0 0 1 9 3"/>' },
|
|
10455
|
+
dataDelayed: { viewBox: "0 0 18 18", body: '<path fill="currentColor" d="M9.17 4.55q1.26 0 2.14.5.9.49 1.36 1.42.48.94.48 2.26v.01q0 1.36-.47 2.31a3.3 3.3 0 0 1-1.36 1.46q-.88.5-2.15.5H6V4.54zm-1.66 7.18h1.46q.84 0 1.43-.34.6-.35.9-1.01t.3-1.61v-.01q0-.93-.3-1.59-.33-.66-.91-1-.6-.35-1.42-.35H7.51z"/>' },
|
|
10456
|
+
dataEndOfDay: { viewBox: "0 0 18 18", body: '<path fill="currentColor" d="M12.25 4q.23.01.3.22a3.85 3.85 0 0 1-1.5 4.41l-.56.37.55.37a3.86 3.86 0 0 1 1.51 4.41.3.3 0 0 1-.3.22h-6.5a.3.3 0 0 1-.3-.22 3.85 3.85 0 0 1 1.5-4.41L7.52 9l-.55-.37a3.86 3.86 0 0 1-1.51-4.41.3.3 0 0 1 .3-.22zm-5.7 1.3c-.04.88.37 1.74 1.13 2.25L9 8.43l1.32-.88a2.6 2.6 0 0 0 1.13-2.25z"/>' },
|
|
10175
10457
|
/** The replay marks, on their native 18 grid. */
|
|
10176
10458
|
// The disc carries the phase in `currentColor`; the rewind stays ONE ink in both modes, because a
|
|
10177
10459
|
// mark that changed the colour of its own shape between modes would read as a different mark.
|
|
@@ -10581,7 +10863,7 @@ function openDialog(options2) {
|
|
|
10581
10863
|
return handle;
|
|
10582
10864
|
}
|
|
10583
10865
|
function dialogTitle(text2, closeLabel, onClose, icons) {
|
|
10584
|
-
const closeButton = h("button", { type: "button", class: "qc-button qc-dialog-close", "aria-label": closeLabel,
|
|
10866
|
+
const closeButton = h("button", { type: "button", class: "qc-button qc-dialog-close", "aria-label": closeLabel, "data-no-tip": "" }, icons.glyph(ICONS.dialogClose, { size: 18 }));
|
|
10585
10867
|
closeButton.addEventListener("click", onClose);
|
|
10586
10868
|
return h("div", { class: "qc-dialog-title" }, h("span", { class: "qc-title" }, text2), closeButton);
|
|
10587
10869
|
}
|
|
@@ -10609,7 +10891,7 @@ function switchControl(options2) {
|
|
|
10609
10891
|
}
|
|
10610
10892
|
function switchRow(options2) {
|
|
10611
10893
|
const control = switchControl(options2);
|
|
10612
|
-
const row2 = h("div", { class: "qc-switch-row", ...options2.hint ? {
|
|
10894
|
+
const row2 = h("div", { class: "qc-switch-row", ...options2.hint ? { "data-qc-tip": options2.hint } : {} }, h("span", { class: "qc-switch-label" }, options2.label), control);
|
|
10613
10895
|
row2.addEventListener("click", (event) => {
|
|
10614
10896
|
if (event.target !== control && !control.contains(event.target)) control.click();
|
|
10615
10897
|
});
|
|
@@ -10620,7 +10902,7 @@ function switchRow(options2) {
|
|
|
10620
10902
|
var NAME_MAX = 64;
|
|
10621
10903
|
function promptHead(t, icons, title, close) {
|
|
10622
10904
|
return [
|
|
10623
|
-
button2({ label: t("layouts.close"), icon: icons.glyph(ICONS.dialogClose, { size: 18 }), className: "qc-dialog-close qc-prompt-close", onClick: close }),
|
|
10905
|
+
button2({ label: t("layouts.close"), noTip: true, icon: icons.glyph(ICONS.dialogClose, { size: 18 }), className: "qc-dialog-close qc-prompt-close", onClick: close }),
|
|
10624
10906
|
h("div", { class: "qc-prompt-title" }, title)
|
|
10625
10907
|
];
|
|
10626
10908
|
}
|
|
@@ -10938,7 +11220,7 @@ function mountSettingsBar(deps) {
|
|
|
10938
11220
|
button({
|
|
10939
11221
|
class: "qc-drawing-star",
|
|
10940
11222
|
label: t("drawing.removeTemplateNamed", { name: template.name }),
|
|
10941
|
-
|
|
11223
|
+
tip: t("drawing.remove"),
|
|
10942
11224
|
icon: deps.icons.icon("trash", 18),
|
|
10943
11225
|
disabled: !deps.available("chart.drawings.template.remove"),
|
|
10944
11226
|
onClick: () => {
|
|
@@ -11067,7 +11349,7 @@ function mountSettingsBar(deps) {
|
|
|
11067
11349
|
place();
|
|
11068
11350
|
const type = selected.type;
|
|
11069
11351
|
const hasStroke = !NO_STROKE.has(type);
|
|
11070
|
-
const templates = gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.drawingTemplates"),
|
|
11352
|
+
const templates = gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.drawingTemplates"), tip: t("drawing.templates"), icon: deps.icons.icon("template") }), "chart.drawings.template.apply");
|
|
11071
11353
|
templates.setAttribute("aria-haspopup", "menu");
|
|
11072
11354
|
templates.setAttribute("aria-expanded", "false");
|
|
11073
11355
|
templates.dataset.qcControl = "templates";
|
|
@@ -11095,16 +11377,16 @@ function mountSettingsBar(deps) {
|
|
|
11095
11377
|
// A table's own edits: a column right of the cell last typed in and a row below it, or at the
|
|
11096
11378
|
// table's ends where no cell is.
|
|
11097
11379
|
tableAddColumn: () => {
|
|
11098
|
-
controls.appendChild(gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.addColumnRight"),
|
|
11380
|
+
controls.appendChild(gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.addColumnRight"), tip: t("drawing.addColumnRight"), icon: deps.icons.icon("tableAddColumn"), onClick: () => deps.run("chart.drawings.tableAddColumn") }), "chart.drawings.tableAddColumn"));
|
|
11099
11381
|
},
|
|
11100
11382
|
tableAddRow: () => {
|
|
11101
|
-
controls.appendChild(gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.addRowBelow"),
|
|
11383
|
+
controls.appendChild(gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.addRowBelow"), tip: t("drawing.addRowBelow"), icon: deps.icons.icon("tableAddRow"), onClick: () => deps.run("chart.drawings.tableAddRow") }), "chart.drawings.tableAddRow"));
|
|
11102
11384
|
},
|
|
11103
11385
|
line: () => strokeColor("pencil16", "drawing.drawingColor", "drawing.color"),
|
|
11104
11386
|
// A mark's ink is its stroke color, which its bar offers as its background.
|
|
11105
11387
|
markFill: () => strokeColor("bucket", "drawing.backgroundColor", "drawing.background"),
|
|
11106
11388
|
fill: () => {
|
|
11107
|
-
const fill = gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.backgroundColor"),
|
|
11389
|
+
const fill = gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.backgroundColor"), tip: t("drawing.background") }), "chart.drawings.style");
|
|
11108
11390
|
fill.appendChild(colorFace("bucket", selected.fillColor, selected.fillOpacity === 0 || deps.selectedProps()?.fillBackground === false));
|
|
11109
11391
|
fill.setAttribute("aria-haspopup", "dialog");
|
|
11110
11392
|
fill.setAttribute("aria-expanded", "false");
|
|
@@ -11161,7 +11443,7 @@ function mountSettingsBar(deps) {
|
|
|
11161
11443
|
}
|
|
11162
11444
|
};
|
|
11163
11445
|
function strokeColor(icon, label3, title) {
|
|
11164
|
-
const color2 = gate(button({ class: "qc-button qc-drawing-bar-button", label: t(label3),
|
|
11446
|
+
const color2 = gate(button({ class: "qc-button qc-drawing-bar-button", label: t(label3), tip: t(title) }), "chart.drawings.style");
|
|
11165
11447
|
color2.appendChild(colorFace(icon, selected.lineColor));
|
|
11166
11448
|
color2.setAttribute("aria-haspopup", "dialog");
|
|
11167
11449
|
color2.setAttribute("aria-expanded", "false");
|
|
@@ -11210,7 +11492,7 @@ function mountSettingsBar(deps) {
|
|
|
11210
11492
|
if (FONT_TOOLS.has(type) && type !== "table") build.size();
|
|
11211
11493
|
if (hasStroke && !NO_LINE_DECOR.has(type)) {
|
|
11212
11494
|
const widths = type === "highlighter" ? HIGHLIGHTER_WIDTHS : WIDTHS;
|
|
11213
|
-
const width = gate(button({ class: "qc-button qc-drawing-bar-button qc-drawing-bar-wide", label: t("drawing.lineThickness"),
|
|
11495
|
+
const width = gate(button({ class: "qc-button qc-drawing-bar-button qc-drawing-bar-wide", label: t("drawing.lineThickness"), tip: t("drawing.thickness") }), "chart.drawings.style");
|
|
11214
11496
|
width.append(widthBar(deps.icons, selected.lineWidth), el("span", { text: `${selected.lineWidth}px` }));
|
|
11215
11497
|
width.setAttribute("aria-haspopup", "menu");
|
|
11216
11498
|
width.setAttribute("aria-expanded", "false");
|
|
@@ -11238,21 +11520,21 @@ function mountSettingsBar(deps) {
|
|
|
11238
11520
|
}
|
|
11239
11521
|
}
|
|
11240
11522
|
controls.append(
|
|
11241
|
-
gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.drawingSettings"),
|
|
11523
|
+
gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.drawingSettings"), tip: t("drawing.settings"), icon: deps.icons.icon("gear"), onClick: () => deps.run("chart.drawings.settings") }), "chart.drawings.settings"),
|
|
11242
11524
|
gate(
|
|
11243
11525
|
button({
|
|
11244
11526
|
class: "qc-button qc-drawing-bar-button",
|
|
11245
11527
|
label: t(selected.locked ? "drawing.unlockDrawing" : "drawing.lockDrawing"),
|
|
11246
|
-
|
|
11528
|
+
tip: t(selected.locked ? "drawing.unlock" : "drawing.lock"),
|
|
11247
11529
|
icon: deps.icons.icon(selected.locked ? "lockClosed" : "lockOpen"),
|
|
11248
11530
|
pressed: selected.locked,
|
|
11249
11531
|
onClick: () => deps.run("chart.drawings.lock", !selected.locked)
|
|
11250
11532
|
}),
|
|
11251
11533
|
"chart.drawings.lock"
|
|
11252
11534
|
),
|
|
11253
|
-
gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.deleteDrawing"),
|
|
11535
|
+
gate(button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.deleteDrawing"), tip: t("drawing.deleteWithKey"), icon: deps.icons.icon("trash28"), onClick: () => deps.run("chart.drawings.deleteSelected") }), "chart.drawings.deleteSelected")
|
|
11254
11536
|
);
|
|
11255
|
-
const more = button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.moreActions"),
|
|
11537
|
+
const more = button({ class: "qc-button qc-drawing-bar-button", label: t("drawing.moreActions"), tip: t("drawing.more"), icon: deps.icons.icon("kebab") });
|
|
11256
11538
|
more.setAttribute("aria-haspopup", "menu");
|
|
11257
11539
|
more.setAttribute("aria-expanded", "false");
|
|
11258
11540
|
more.dataset.qcControl = "more";
|
|
@@ -13670,7 +13952,7 @@ function openSettingsDialog(deps) {
|
|
|
13670
13952
|
button({
|
|
13671
13953
|
class: "qc-drawing-star",
|
|
13672
13954
|
label: t("drawing.removeTemplateNamed", { name: saved1.name }),
|
|
13673
|
-
|
|
13955
|
+
tip: t("drawing.remove"),
|
|
13674
13956
|
icon: deps.icons.icon("trash", 18),
|
|
13675
13957
|
disabled: !deps.available("chart.drawings.template.remove"),
|
|
13676
13958
|
onClick: () => {
|
|
@@ -15642,9 +15924,12 @@ function attachIndicatorsPlane(deps) {
|
|
|
15642
15924
|
const def = inst.definition;
|
|
15643
15925
|
const title = indicatorTitleOf(inst, deps.i18n.t);
|
|
15644
15926
|
const placement = def.manifest.pane === "pane" ? "pane" : "overlay";
|
|
15927
|
+
const mark = indicatorMarkOf(inst, deps.i18n.t);
|
|
15645
15928
|
const base = {
|
|
15646
15929
|
id: inst.id,
|
|
15647
|
-
title:
|
|
15930
|
+
title: mark,
|
|
15931
|
+
// The full name, which the row's bubble shows where the mark says less.
|
|
15932
|
+
...title !== mark ? { description: title } : {},
|
|
15648
15933
|
inputs: inst.overrides?.display?.inputsInStatusLine === false ? void 0 : indicatorInputsOf(inst),
|
|
15649
15934
|
color: effectivePlotColor(def.manifest, Object.keys(def.manifest.plots)[0] ?? "", inst.overrides, inst.color ?? ""),
|
|
15650
15935
|
hasInputs: Object.keys(def.manifest.inputs ?? {}).length > 0,
|
|
@@ -17375,6 +17660,18 @@ function createSymbolBadge(displayName) {
|
|
|
17375
17660
|
}
|
|
17376
17661
|
|
|
17377
17662
|
// src/chartLegend.ts
|
|
17663
|
+
var STATUS_GLYPH = {
|
|
17664
|
+
open: ICONS.marketStatus,
|
|
17665
|
+
unknown: ICONS.marketStatus,
|
|
17666
|
+
pre: ICONS.marketPreMarket,
|
|
17667
|
+
post: ICONS.marketAfterHours,
|
|
17668
|
+
overnight: ICONS.marketAfterHours,
|
|
17669
|
+
extended: ICONS.marketAfterHours,
|
|
17670
|
+
closed: ICONS.marketClosed,
|
|
17671
|
+
holiday: ICONS.marketHoliday,
|
|
17672
|
+
delayed: ICONS.dataDelayed,
|
|
17673
|
+
endOfDay: ICONS.dataEndOfDay
|
|
17674
|
+
};
|
|
17378
17675
|
var IDENTITY_MARK_SIZE = 18;
|
|
17379
17676
|
var ROW_MARK_SIZE = 18;
|
|
17380
17677
|
var OPEN_LEGEND_LOOK = {
|
|
@@ -17431,26 +17728,40 @@ function mountChartLegend(container, strings, controls) {
|
|
|
17431
17728
|
const identityBand = document.createElement("span");
|
|
17432
17729
|
identityBand.className = "qc-legend-identity";
|
|
17433
17730
|
identityBand.append(badge.element, name2, detail.sep, detail.text, timeframe2.sep, timeframe2.text, venue.sep, venue.text);
|
|
17434
|
-
const
|
|
17731
|
+
const statusMarks = document.createElement("span");
|
|
17732
|
+
statusMarks.className = "qc-legend-marks";
|
|
17435
17733
|
let statusButton = null;
|
|
17734
|
+
const paintStatus = (marks2) => {
|
|
17735
|
+
statusMarks.replaceChildren(
|
|
17736
|
+
...marks2.map((mark) => {
|
|
17737
|
+
const badge2 = document.createElement("span");
|
|
17738
|
+
badge2.className = "qc-legend-mark qc-status-mark";
|
|
17739
|
+
badge2.dataset.qcMark = mark.kind;
|
|
17740
|
+
badge2.dataset.qcTip = mark.title;
|
|
17741
|
+
badge2.appendChild(controls.icons.glyph(STATUS_GLYPH[mark.kind], { size: 18 }));
|
|
17742
|
+
return badge2;
|
|
17743
|
+
})
|
|
17744
|
+
);
|
|
17745
|
+
if (statusButton) statusButton.dataset.qcTip = marks2[0]?.title ?? strings.t("status.unknownTitle");
|
|
17746
|
+
};
|
|
17436
17747
|
if (controls.onStatus) {
|
|
17437
17748
|
statusButton = document.createElement("button");
|
|
17438
17749
|
statusButton.type = "button";
|
|
17439
17750
|
statusButton.className = "qc-legend-action qc-legend-status";
|
|
17440
17751
|
statusButton.setAttribute("aria-haspopup", "dialog");
|
|
17441
17752
|
statusButton.setAttribute("aria-expanded", "false");
|
|
17442
|
-
statusButton.title = strings.t("status.title");
|
|
17443
17753
|
statusButton.setAttribute("aria-label", strings.t("status.title"));
|
|
17444
17754
|
statusButton.addEventListener("click", () => controls.onStatus?.(statusButton));
|
|
17445
|
-
statusButton.appendChild(
|
|
17755
|
+
statusButton.appendChild(statusMarks);
|
|
17446
17756
|
identityBand.appendChild(statusButton);
|
|
17447
17757
|
} else {
|
|
17448
|
-
identityBand.appendChild(
|
|
17758
|
+
identityBand.appendChild(statusMarks);
|
|
17449
17759
|
}
|
|
17760
|
+
paintStatus([{ kind: "unknown", title: strings.t("status.unknownTitle") }]);
|
|
17450
17761
|
const replayPill = document.createElement("span");
|
|
17451
17762
|
replayPill.className = "qc-legend-replay";
|
|
17452
17763
|
replayPill.hidden = true;
|
|
17453
|
-
replayPill.
|
|
17764
|
+
replayPill.dataset.qcTip = strings.t("replay.watermark");
|
|
17454
17765
|
replayPill.append(controls.icons.glyph(ICONS.replayStatus, { size: 18 }));
|
|
17455
17766
|
identityBand.appendChild(replayPill);
|
|
17456
17767
|
header.appendChild(identityBand);
|
|
@@ -17518,8 +17829,7 @@ function mountChartLegend(container, strings, controls) {
|
|
|
17518
17829
|
const paintToggle = () => {
|
|
17519
17830
|
root.dataset.rowsCollapsed = String(rowsCollapsed);
|
|
17520
17831
|
listToggle.setAttribute("aria-expanded", String(!rowsCollapsed));
|
|
17521
|
-
listToggle.
|
|
17522
|
-
listToggle.setAttribute("aria-label", listToggle.title);
|
|
17832
|
+
listToggle.setAttribute("aria-label", strings.t(rowsCollapsed ? "legend.showRows" : "legend.hideRows"));
|
|
17523
17833
|
listToggle.replaceChildren(controls.icons.glyph(ICONS.legendChevron, { size: 15 }));
|
|
17524
17834
|
};
|
|
17525
17835
|
listToggle.addEventListener("click", () => {
|
|
@@ -17539,11 +17849,10 @@ function mountChartLegend(container, strings, controls) {
|
|
|
17539
17849
|
plotCorner.setAttribute("aria-hidden", "true");
|
|
17540
17850
|
plotCorner.appendChild(controls.icons.glyph(ICONS.productMark, { size: 28 }));
|
|
17541
17851
|
container.appendChild(plotCorner);
|
|
17542
|
-
const chipButton = (glyphOrText,
|
|
17852
|
+
const chipButton = (glyphOrText, onClick) => {
|
|
17543
17853
|
const b = document.createElement("button");
|
|
17544
17854
|
b.type = "button";
|
|
17545
17855
|
b.className = "qc-legend-action";
|
|
17546
|
-
b.title = titleText;
|
|
17547
17856
|
if (typeof glyphOrText === "string") b.textContent = glyphOrText;
|
|
17548
17857
|
else b.appendChild(glyphOrText);
|
|
17549
17858
|
b.addEventListener("click", onClick);
|
|
@@ -17580,7 +17889,7 @@ function mountChartLegend(container, strings, controls) {
|
|
|
17580
17889
|
const labelInputs = document.createElement("span");
|
|
17581
17890
|
labelInputs.className = "qc-legend-inputs";
|
|
17582
17891
|
label3.append(labelName, labelInputs);
|
|
17583
|
-
const title = chipButton("",
|
|
17892
|
+
const title = chipButton("", () => controls.onTitle?.(chip.id));
|
|
17584
17893
|
title.classList.add("qc-legend-title");
|
|
17585
17894
|
const rowMark = createSymbolBadge("");
|
|
17586
17895
|
rowMark.element.classList.add("qc-legend-row-mark");
|
|
@@ -17593,19 +17902,20 @@ function mountChartLegend(container, strings, controls) {
|
|
|
17593
17902
|
const value = document.createElement("span");
|
|
17594
17903
|
value.className = "qc-legend-value";
|
|
17595
17904
|
value.dataset.role = "legend-indicator-value";
|
|
17596
|
-
const gear = chipButton(controls.icons.glyph(ICONS.legendSettings, { size: 18 }),
|
|
17905
|
+
const gear = chipButton(controls.icons.glyph(ICONS.legendSettings, { size: 18 }), () => {
|
|
17597
17906
|
const r = gear.getBoundingClientRect();
|
|
17598
17907
|
controls.onSettings?.(chip.id, { x: r.x, y: r.y, w: r.width, h: r.height });
|
|
17599
17908
|
});
|
|
17600
|
-
const eye2 = chipButton("",
|
|
17909
|
+
const eye2 = chipButton("", () => controls.onToggleEye(chip.id));
|
|
17601
17910
|
eye2.classList.add("qc-legend-eye");
|
|
17602
|
-
const remove = chipButton(controls.icons.glyph(ICONS.trash, { size: 18 }),
|
|
17911
|
+
const remove = chipButton(controls.icons.glyph(ICONS.trash, { size: 18 }), () => controls.onRemove?.(chip.id));
|
|
17603
17912
|
const actions2 = document.createElement("span");
|
|
17604
17913
|
actions2.className = "qc-legend-actions";
|
|
17605
17914
|
actions2.append(eye2, gear, remove);
|
|
17606
|
-
const nameButton = (button3, text2) => {
|
|
17607
|
-
button3.title = text2;
|
|
17915
|
+
const nameButton = (button3, text2, words = null) => {
|
|
17608
17916
|
button3.setAttribute("aria-label", text2);
|
|
17917
|
+
if (words === null) button3.removeAttribute("data-qc-tip");
|
|
17918
|
+
else button3.dataset.qcTip = words;
|
|
17609
17919
|
};
|
|
17610
17920
|
row2.append(rowMark.element, label3, title, venueSep, venueText, value, actions2);
|
|
17611
17921
|
return {
|
|
@@ -17613,7 +17923,8 @@ function mountChartLegend(container, strings, controls) {
|
|
|
17613
17923
|
update(next) {
|
|
17614
17924
|
chip = next;
|
|
17615
17925
|
row2.dataset.qcHidden = String(chip.hidden);
|
|
17616
|
-
|
|
17926
|
+
if (chip.description) label3.dataset.qcTip = chip.description;
|
|
17927
|
+
else label3.removeAttribute("data-qc-tip");
|
|
17617
17928
|
rowMark.element.hidden = !chip.mark;
|
|
17618
17929
|
if (!chip.mark) {
|
|
17619
17930
|
dropMark?.();
|
|
@@ -17651,16 +17962,16 @@ function mountChartLegend(container, strings, controls) {
|
|
|
17651
17962
|
if (chip.tone && !chip.hidden && !chip.note) value.dataset.qcTone = chip.tone;
|
|
17652
17963
|
else delete value.dataset.qcTone;
|
|
17653
17964
|
gear.hidden = !chip.hasInputs || !controls.onSettings;
|
|
17654
|
-
nameButton(gear, chip.settingsLabel ?? strings.t("legend.indicatorSettings"));
|
|
17965
|
+
nameButton(gear, chip.settingsLabel ?? strings.t("legend.indicatorSettings"), chip.settingsLabel ? null : strings.t("drawing.settings"));
|
|
17655
17966
|
const eyeState = String(chip.hidden);
|
|
17656
17967
|
if (eye2.dataset.hidden !== eyeState) {
|
|
17657
17968
|
eye2.replaceChildren(controls.icons.glyph(chip.hidden ? ICONS.legendEyeOff : ICONS.legendEye, { size: 18 }));
|
|
17658
17969
|
eye2.dataset.hidden = eyeState;
|
|
17659
17970
|
}
|
|
17660
|
-
nameButton(eye2, strings.t(chip.hidden ? "legend.showIndicator" : "legend.hideIndicator"));
|
|
17971
|
+
nameButton(eye2, strings.t(chip.hidden ? "legend.showIndicator" : "legend.hideIndicator"), strings.t(chip.hidden ? "legend.show" : "drawing.hide"));
|
|
17661
17972
|
eye2.hidden = chip.hideable === false;
|
|
17662
17973
|
remove.hidden = !chip.removable || !controls.onRemove;
|
|
17663
|
-
nameButton(remove, chip.removeLabel ?? strings.t("legend.removeCompare"));
|
|
17974
|
+
nameButton(remove, chip.removeLabel ?? strings.t("legend.removeCompare"), strings.t("drawing.remove"));
|
|
17664
17975
|
},
|
|
17665
17976
|
/** Give a host's mark back before the row leaves, so nothing the host owns outlives the row
|
|
17666
17977
|
* it was painted into. */
|
|
@@ -17757,7 +18068,8 @@ function mountChartLegend(container, strings, controls) {
|
|
|
17757
18068
|
badge.element.hidden = !look.title || !look.logo;
|
|
17758
18069
|
name2.hidden = !look.title;
|
|
17759
18070
|
name2.textContent = identity?.name ?? "";
|
|
17760
|
-
name2.
|
|
18071
|
+
if (identity?.fullName) name2.dataset.qcTip = identity.fullName;
|
|
18072
|
+
else name2.removeAttribute("data-qc-tip");
|
|
17761
18073
|
const facts = [
|
|
17762
18074
|
[detail, identity?.detail ?? ""],
|
|
17763
18075
|
[timeframe2, identity?.timeframe ?? ""],
|
|
@@ -17797,11 +18109,8 @@ function mountChartLegend(container, strings, controls) {
|
|
|
17797
18109
|
replayWatermark.style.opacity = look.replayMarkColor ? "1" : "";
|
|
17798
18110
|
};
|
|
17799
18111
|
const unsubscribe = strings.onChange(() => {
|
|
17800
|
-
if (statusButton)
|
|
17801
|
-
|
|
17802
|
-
statusButton.setAttribute("aria-label", strings.t("status.title"));
|
|
17803
|
-
}
|
|
17804
|
-
replayPill.title = strings.t("replay.watermark");
|
|
18112
|
+
if (statusButton) statusButton.setAttribute("aria-label", strings.t("status.title"));
|
|
18113
|
+
replayPill.dataset.qcTip = strings.t("replay.watermark");
|
|
17805
18114
|
replayWatermarkText.textContent = strings.t("replay.watermark");
|
|
17806
18115
|
paintQuote();
|
|
17807
18116
|
render(lastChips);
|
|
@@ -17850,14 +18159,13 @@ function mountChartLegend(container, strings, controls) {
|
|
|
17850
18159
|
paintFit();
|
|
17851
18160
|
}
|
|
17852
18161
|
},
|
|
17853
|
-
|
|
17854
|
-
|
|
17855
|
-
if (statusButton) statusButton.title = title ?? strings.t("status.unknownTitle");
|
|
18162
|
+
setStatus(marks2) {
|
|
18163
|
+
paintStatus(marks2);
|
|
17856
18164
|
},
|
|
17857
18165
|
setReplay(phase) {
|
|
17858
18166
|
const on = phase !== "off";
|
|
17859
18167
|
if (statusButton) statusButton.hidden = on;
|
|
17860
|
-
else
|
|
18168
|
+
else statusMarks.hidden = on;
|
|
17861
18169
|
replayPill.hidden = !on;
|
|
17862
18170
|
replayPill.dataset.qcPhase = phase;
|
|
17863
18171
|
replayOn = on;
|
|
@@ -18219,7 +18527,16 @@ var CONTROL_ICONS = byMeaning({
|
|
|
18219
18527
|
paneMaximize: [ICONS.paneMaximize15],
|
|
18220
18528
|
paneMoveUp: [ICONS.paneUp15],
|
|
18221
18529
|
paneMoveDown: [ICONS.paneDown15],
|
|
18530
|
+
// The status marks: the open market (and a session not yet known), pre-market, the hours after
|
|
18531
|
+
// the regular session (post-market, overnight and extended hours), the closed market, a holiday,
|
|
18532
|
+
// delayed data and end-of-day data.
|
|
18222
18533
|
marketStatus: [ICONS.marketStatus],
|
|
18534
|
+
marketPreMarket: [ICONS.marketPreMarket],
|
|
18535
|
+
marketAfterHours: [ICONS.marketAfterHours],
|
|
18536
|
+
marketClosed: [ICONS.marketClosed],
|
|
18537
|
+
marketHoliday: [ICONS.marketHoliday],
|
|
18538
|
+
dataDelayed: [ICONS.dataDelayed],
|
|
18539
|
+
dataEndOfDay: [ICONS.dataEndOfDay],
|
|
18223
18540
|
replayStatus: [ICONS.replayStatus],
|
|
18224
18541
|
replayMark: [ICONS.replayMark],
|
|
18225
18542
|
replayCut: [ICONS.replayCut],
|
|
@@ -18825,19 +19142,17 @@ function menuSeparator() {
|
|
|
18825
19142
|
}
|
|
18826
19143
|
|
|
18827
19144
|
// src/ui/chrome/marketStatus.ts
|
|
18828
|
-
var
|
|
18829
|
-
|
|
18830
|
-
|
|
18831
|
-
|
|
18832
|
-
|
|
18833
|
-
|
|
18834
|
-
|
|
18835
|
-
|
|
18836
|
-
|
|
18837
|
-
|
|
18838
|
-
|
|
18839
|
-
}
|
|
18840
|
-
return out;
|
|
19145
|
+
var POPUP_WIDTH = 344;
|
|
19146
|
+
var MINUTES_PER_DAY2 = 1440;
|
|
19147
|
+
var clock = (mins) => mins >= MINUTES_PER_DAY2 ? "24:00" : `${String(Math.floor(mins / 60)).padStart(2, "0")}:${String(mins % 60).padStart(2, "0")}`;
|
|
19148
|
+
function timelineMarks(tl) {
|
|
19149
|
+
const stretch = tl.segments.find((s) => tl.nowMins >= s.start && tl.nowMins < s.end) ?? tl.segments[tl.segments.length - 1];
|
|
19150
|
+
if (!stretch) return [];
|
|
19151
|
+
const whole = stretch.start <= 0 && stretch.end >= MINUTES_PER_DAY2;
|
|
19152
|
+
const marks = [];
|
|
19153
|
+
if (whole || stretch.start > 0 || tl.before !== stretch.state) marks.push({ mins: stretch.start, text: clock(stretch.start) });
|
|
19154
|
+
if (whole || stretch.end < MINUTES_PER_DAY2 || tl.after !== stretch.state) marks.push({ mins: stretch.end, text: clock(stretch.end) });
|
|
19155
|
+
return marks;
|
|
18841
19156
|
}
|
|
18842
19157
|
function openMarketStatus(anchor, deps) {
|
|
18843
19158
|
const t = deps.i18n.t;
|
|
@@ -18850,9 +19165,48 @@ function openMarketStatus(anchor, deps) {
|
|
|
18850
19165
|
offLocale();
|
|
18851
19166
|
offLocale = () => void 0;
|
|
18852
19167
|
};
|
|
18853
|
-
const
|
|
18854
|
-
const
|
|
18855
|
-
return h("
|
|
19168
|
+
const section = (kind, title, ...content) => {
|
|
19169
|
+
const badge = h("span", { class: "qc-status-mark qc-status-badge", "data-qc-mark": kind }, deps.icons.glyph(STATUS_GLYPH[kind], { size: 18 }));
|
|
19170
|
+
return h("section", { class: "qc-status-section", "data-qc-mark": kind }, badge, h("div", { class: "qc-status-content" }, h("div", { class: "qc-status-title" }, title), ...content));
|
|
19171
|
+
};
|
|
19172
|
+
const words = (sentence, countdown) => {
|
|
19173
|
+
const text2 = h("p", { class: "qc-status-text" });
|
|
19174
|
+
if (!countdown) {
|
|
19175
|
+
text2.textContent = sentence;
|
|
19176
|
+
return text2;
|
|
19177
|
+
}
|
|
19178
|
+
const joined = t("status.textPair", { sentence, countdown });
|
|
19179
|
+
const at2 = joined.lastIndexOf(countdown);
|
|
19180
|
+
if (at2 < 0) {
|
|
19181
|
+
text2.append(sentence, " ", h("strong", { class: "qc-status-countdown" }, countdown));
|
|
19182
|
+
return text2;
|
|
19183
|
+
}
|
|
19184
|
+
text2.append(joined.slice(0, at2), h("strong", { class: "qc-status-countdown" }, countdown), joined.slice(at2 + countdown.length));
|
|
19185
|
+
return text2;
|
|
19186
|
+
};
|
|
19187
|
+
const timeline = (model, nowSecs) => {
|
|
19188
|
+
const tl = sessionTimeline(model, nowSecs, deps.i18n.tag());
|
|
19189
|
+
const bar = h("div", { class: "qc-status-bar", "aria-hidden": "true" });
|
|
19190
|
+
for (const s of tl.segments) {
|
|
19191
|
+
const segment = h("div", { class: "qc-status-segment", "data-qc-session": s.state });
|
|
19192
|
+
segment.style.flexGrow = String(s.end - s.start);
|
|
19193
|
+
bar.appendChild(segment);
|
|
19194
|
+
}
|
|
19195
|
+
const marker = h("div", { class: "qc-status-now" });
|
|
19196
|
+
marker.style.insetInlineStart = `${tl.nowMins / MINUTES_PER_DAY2 * 100}%`;
|
|
19197
|
+
const track = h("div", { class: "qc-status-track" }, bar, marker);
|
|
19198
|
+
const day = h("span", { class: "qc-status-day", "data-qc-active": "true" }, tl.dayLabel);
|
|
19199
|
+
const marks = h("div", { class: "qc-status-marks", "aria-hidden": "true" });
|
|
19200
|
+
for (const mark of timelineMarks(tl)) {
|
|
19201
|
+
const label3 = h("span", { class: "qc-status-time" }, mark.text);
|
|
19202
|
+
label3.style.setProperty("--qcd-at", `${mark.mins / MINUTES_PER_DAY2 * 100}%`);
|
|
19203
|
+
marks.appendChild(label3);
|
|
19204
|
+
}
|
|
19205
|
+
return [
|
|
19206
|
+
h("div", { class: "qc-status-timeline" }, day, track),
|
|
19207
|
+
marks,
|
|
19208
|
+
h("div", { class: "qc-status-footer" }, exchangeTimezoneText(t, tl.timezone, new Date(nowSecs * 1e3)))
|
|
19209
|
+
];
|
|
18856
19210
|
};
|
|
18857
19211
|
const menu2 = openMenu({
|
|
18858
19212
|
host: deps.host,
|
|
@@ -18860,38 +19214,18 @@ function openMarketStatus(anchor, deps) {
|
|
|
18860
19214
|
label: t("status.title"),
|
|
18861
19215
|
role: "dialog",
|
|
18862
19216
|
className: "qc-status-popup",
|
|
18863
|
-
width:
|
|
19217
|
+
width: POPUP_WIDTH,
|
|
18864
19218
|
build(body) {
|
|
18865
19219
|
const model = deps.model();
|
|
18866
19220
|
const nowSecs = now();
|
|
18867
19221
|
const status2 = model ? deps.status(nowSecs) : null;
|
|
18868
19222
|
if (!model || !status2) {
|
|
18869
|
-
body.append(
|
|
19223
|
+
body.append(section("unknown", t("status.unknownTitle"), words(t("status.unknown"), null)));
|
|
18870
19224
|
return;
|
|
18871
19225
|
}
|
|
18872
|
-
body.append(
|
|
18873
|
-
const
|
|
18874
|
-
|
|
18875
|
-
for (const s of tl.segments) {
|
|
18876
|
-
const segment = h("div", { class: "qc-status-segment", "data-qc-session": s.state });
|
|
18877
|
-
segment.style.width = `${(s.end - s.start) / 1440 * 100}%`;
|
|
18878
|
-
bar.appendChild(segment);
|
|
18879
|
-
}
|
|
18880
|
-
const marker = h("div", { class: "qc-status-now" });
|
|
18881
|
-
marker.style.insetInlineStart = `${tl.nowMins / 1440 * 100}%`;
|
|
18882
|
-
const track = h("div", { class: "qc-status-track" }, bar, marker);
|
|
18883
|
-
body.appendChild(h("div", { class: "qc-status-timeline" }, h("span", { class: "qc-status-day qc-muted" }, tl.dayLabel), track));
|
|
18884
|
-
const labels = timelineLabels(tl.segments.map((s) => s.start));
|
|
18885
|
-
if (labels.length > 0) {
|
|
18886
|
-
const row2 = h("div", { class: "qc-status-labels", "aria-hidden": "true" });
|
|
18887
|
-
for (const l of labels) {
|
|
18888
|
-
const label3 = h("span", { class: "qc-status-label qc-muted" }, l.text);
|
|
18889
|
-
label3.style.insetInlineStart = `${l.mins / 1440 * 100}%`;
|
|
18890
|
-
row2.appendChild(label3);
|
|
18891
|
-
}
|
|
18892
|
-
body.appendChild(row2);
|
|
18893
|
-
}
|
|
18894
|
-
body.appendChild(h("div", { class: "qc-status-footer qc-muted" }, exchangeTimezoneText(t, tl.timezone, new Date(nowSecs * 1e3))));
|
|
19226
|
+
body.append(section(status2.phase, marketStatusTitle(t, status2), words(marketStatusSentence(t, status2), marketStatusCountdown(t, status2, nowSecs)), ...timeline(model, nowSecs)));
|
|
19227
|
+
const data = dataStatusNotice(t, status2.dataStatus);
|
|
19228
|
+
if (data) body.append(section(status2.dataStatus === "endofday" ? "endOfDay" : "delayed", data.title, words(data.text, null)));
|
|
18895
19229
|
},
|
|
18896
19230
|
onClose() {
|
|
18897
19231
|
stopUpdates();
|
|
@@ -18938,7 +19272,7 @@ function legendLook(settings2) {
|
|
|
18938
19272
|
}
|
|
18939
19273
|
function legendIdentity(symbol, info, timeframe2, source3) {
|
|
18940
19274
|
const names = symbolNames(info ?? symbol);
|
|
18941
|
-
const base = { symbol, mark: names.mark, timeframe: timeframe2, exchange: info?.exchange ?? "" };
|
|
19275
|
+
const base = { symbol, mark: names.mark, timeframe: timeframe2, exchange: info?.exchange ?? "", ...info ? { fullName: names.description } : {} };
|
|
18942
19276
|
if (source3 === "symbol") return { ...base, name: names.mark };
|
|
18943
19277
|
if (source3 === "symbolAndName") return names.description === names.mark ? { ...base, name: names.mark } : { ...base, name: names.mark, detail: names.description };
|
|
18944
19278
|
return { ...base, name: names.description };
|
|
@@ -18958,7 +19292,7 @@ function attachLegendPlane(deps) {
|
|
|
18958
19292
|
return {
|
|
18959
19293
|
push: () => void 0,
|
|
18960
19294
|
setHeader: () => void 0,
|
|
18961
|
-
|
|
19295
|
+
setStatus: () => void 0,
|
|
18962
19296
|
setHostRows: () => void 0,
|
|
18963
19297
|
setSlotRows: () => void 0,
|
|
18964
19298
|
destroy: () => void 0
|
|
@@ -19011,6 +19345,7 @@ function attachLegendPlane(deps) {
|
|
|
19011
19345
|
status2 = openMarketStatus(anchor, {
|
|
19012
19346
|
host: deps.chrome,
|
|
19013
19347
|
i18n: deps.i18n,
|
|
19348
|
+
icons: deps.icons,
|
|
19014
19349
|
model: deps.sessionModel,
|
|
19015
19350
|
status: deps.status,
|
|
19016
19351
|
onClose: () => {
|
|
@@ -19039,6 +19374,20 @@ function attachLegendPlane(deps) {
|
|
|
19039
19374
|
);
|
|
19040
19375
|
}
|
|
19041
19376
|
});
|
|
19377
|
+
const paintStatus = () => {
|
|
19378
|
+
const t = deps.i18n.t;
|
|
19379
|
+
const current = deps.status(Math.floor(Date.now() / 1e3));
|
|
19380
|
+
if (!current) {
|
|
19381
|
+
legend2?.setStatus([{ kind: "unknown", title: t("status.unknownTitle") }]);
|
|
19382
|
+
return;
|
|
19383
|
+
}
|
|
19384
|
+
const data = dataStatusNotice(t, current.dataStatus);
|
|
19385
|
+
legend2?.setStatus([
|
|
19386
|
+
{ kind: current.phase, title: marketStatusTitle(t, current) },
|
|
19387
|
+
...data ? [{ kind: current.dataStatus === "endofday" ? "endOfDay" : "delayed", title: data.title }] : []
|
|
19388
|
+
]);
|
|
19389
|
+
};
|
|
19390
|
+
const offStatusWords = deps.i18n.onChange(paintStatus);
|
|
19042
19391
|
function reading() {
|
|
19043
19392
|
const bars = deps.bars();
|
|
19044
19393
|
const index = barIndexAt(bars, hovered);
|
|
@@ -19183,13 +19532,13 @@ function attachLegendPlane(deps) {
|
|
|
19183
19532
|
}
|
|
19184
19533
|
writeIdentity();
|
|
19185
19534
|
},
|
|
19186
|
-
|
|
19187
|
-
|
|
19188
|
-
legend2?.setDot(state, current ? marketStatusTitle(deps.i18n.t, current) : deps.i18n.t("status.unknownTitle"));
|
|
19535
|
+
setStatus() {
|
|
19536
|
+
paintStatus();
|
|
19189
19537
|
status2?.refresh();
|
|
19190
19538
|
},
|
|
19191
19539
|
destroy() {
|
|
19192
19540
|
destroyed = true;
|
|
19541
|
+
offStatusWords();
|
|
19193
19542
|
hostRows.clear();
|
|
19194
19543
|
resize?.disconnect();
|
|
19195
19544
|
observed.clear();
|
|
@@ -20401,29 +20750,29 @@ function attachMarks(deps) {
|
|
|
20401
20750
|
};
|
|
20402
20751
|
const paneLeft = () => deps.paneLeft?.() ?? 0;
|
|
20403
20752
|
const paneTop = () => deps.paneTop?.() ?? 0;
|
|
20404
|
-
let
|
|
20753
|
+
let tip2 = null;
|
|
20405
20754
|
const showTip = (hovered) => {
|
|
20406
20755
|
const overlay = deps.overlay;
|
|
20407
20756
|
if (!overlay) return;
|
|
20408
20757
|
const words = hovered?.mark.label;
|
|
20409
20758
|
if (!hovered || typeof words !== "string" || words === "") {
|
|
20410
|
-
if (
|
|
20759
|
+
if (tip2) tip2.hidden = true;
|
|
20411
20760
|
return;
|
|
20412
20761
|
}
|
|
20413
|
-
if (!
|
|
20414
|
-
|
|
20415
|
-
|
|
20416
|
-
|
|
20417
|
-
overlay.append(
|
|
20762
|
+
if (!tip2) {
|
|
20763
|
+
tip2 = overlay.ownerDocument.createElement("div");
|
|
20764
|
+
tip2.className = "qc-mark-tooltip";
|
|
20765
|
+
tip2.setAttribute("role", "tooltip");
|
|
20766
|
+
overlay.append(tip2);
|
|
20418
20767
|
}
|
|
20419
|
-
|
|
20420
|
-
|
|
20421
|
-
const width =
|
|
20768
|
+
tip2.textContent = words;
|
|
20769
|
+
tip2.hidden = false;
|
|
20770
|
+
const width = tip2.offsetWidth;
|
|
20422
20771
|
const room = overlay.clientWidth;
|
|
20423
20772
|
const centre = paneLeft() + hovered.x;
|
|
20424
20773
|
const left = room > 0 ? Math.max(4, Math.min(centre - width / 2, room - width - 4)) : centre - width / 2;
|
|
20425
|
-
|
|
20426
|
-
|
|
20774
|
+
tip2.style.left = `${Math.round(left)}px`;
|
|
20775
|
+
tip2.style.top = `${Math.round(paneTop() + hovered.top - 4)}px`;
|
|
20427
20776
|
};
|
|
20428
20777
|
const axisPrimitive = createTimescaleMarks({
|
|
20429
20778
|
chart: deps.chart,
|
|
@@ -20541,7 +20890,7 @@ function attachMarks(deps) {
|
|
|
20541
20890
|
deps.gestures?.removeEventListener("pointermove", onMove);
|
|
20542
20891
|
deps.gestures?.removeEventListener("pointerleave", onLeave);
|
|
20543
20892
|
deps.gestures?.removeEventListener("pointerdown", onDown);
|
|
20544
|
-
|
|
20893
|
+
tip2?.remove();
|
|
20545
20894
|
try {
|
|
20546
20895
|
plugin?.setMarkers([]);
|
|
20547
20896
|
} catch {
|
|
@@ -20767,10 +21116,12 @@ function mountScaleControls(deps) {
|
|
|
20767
21116
|
modes.setAttribute("aria-label", t("chrome.scaleModes"));
|
|
20768
21117
|
auto.textContent = t("chrome.autoScaleMark");
|
|
20769
21118
|
name(auto, t("chrome.autoScale"));
|
|
21119
|
+
tip(auto, t("menu.autoFitScale"));
|
|
20770
21120
|
log.textContent = t("chrome.logScaleMark");
|
|
20771
21121
|
name(log, t("chrome.logScale"));
|
|
21122
|
+
tip(log, t("menu.scaleLogarithmic"));
|
|
20772
21123
|
name(plus, t("chrome.priceLevelMenu"));
|
|
20773
|
-
if (door) unit.
|
|
21124
|
+
if (door) unit.dataset.qcTip = t("settings.currencyAndUnit");
|
|
20774
21125
|
if (corner) name(corner, t("chrome.scaleMenu"));
|
|
20775
21126
|
};
|
|
20776
21127
|
const syncCorner = () => {
|
|
@@ -21817,7 +22168,7 @@ function registerChartCommands(deps) {
|
|
|
21817
22168
|
id: "chart.subsession.extended",
|
|
21818
22169
|
scope: "chart",
|
|
21819
22170
|
label: "command.subsessionExtended",
|
|
21820
|
-
available: () => handle.hasExtendedHours() && handle.
|
|
22171
|
+
available: () => handle.hasExtendedHours() && handle.settings().symbol.session !== "extended",
|
|
21821
22172
|
execute: () => handle.setSubsession("extended")
|
|
21822
22173
|
});
|
|
21823
22174
|
return () => {
|
|
@@ -21851,6 +22202,12 @@ function scaleMenuGroups(deps) {
|
|
|
21851
22202
|
const ratio = deps.ratio();
|
|
21852
22203
|
const extended = deps.extendedHours();
|
|
21853
22204
|
const locked = scale.lockPriceToBarRatio;
|
|
22205
|
+
const hoursOptions = deps.tradingHours();
|
|
22206
|
+
const activeHours = tradingHoursOption(hoursOptions, settings2.symbol.session);
|
|
22207
|
+
const hoursRow = (option) => {
|
|
22208
|
+
const row2 = { label: t(option.label), checked: option.hours === activeHours?.hours };
|
|
22209
|
+
return option.hours === "allHours" ? apply(row2, { symbol: { session: "allHours" } }) : door(`chart.subsession.${option.hours}`, row2);
|
|
22210
|
+
};
|
|
21854
22211
|
return [
|
|
21855
22212
|
door("chart.view.reset", { label: t("menu.resetPriceScale"), icon: "reset", ...hint("chart.view.reset") }),
|
|
21856
22213
|
[
|
|
@@ -21902,6 +22259,7 @@ function scaleMenuGroups(deps) {
|
|
|
21902
22259
|
]),
|
|
21903
22260
|
...label3(t("settings.plusButton"), labels.plusButton, (plusButton) => ({ plusButton }))
|
|
21904
22261
|
],
|
|
22262
|
+
flyout(t("settings.session"), [hoursOptions.flatMap(hoursRow)]),
|
|
21905
22263
|
deps.settingsDoor ? door("chart.settings.open", { label: t("menu.moreSettings"), icon: "settings" }, { page: "scales" }) : []
|
|
21906
22264
|
].filter((group) => group.length > 0);
|
|
21907
22265
|
}
|
|
@@ -22770,12 +23128,15 @@ function createChartInstance(deps) {
|
|
|
22770
23128
|
after: eff.symbol.postMarketColor,
|
|
22771
23129
|
// The overnight stretch is its own color under every trading hour and left clear otherwise.
|
|
22772
23130
|
extended: eff.symbol.session === "allHours" ? eff.symbol.nightColor : null,
|
|
23131
|
+
// An electronic day shades everything outside its regular hours in one color.
|
|
23132
|
+
electronic: eff.symbol.electronicColor,
|
|
22773
23133
|
breaks: eff.events.sessionBreaks ? { color: eff.events.sessionBreaksColor, width: eff.events.sessionBreaksWidth, style: eff.events.sessionBreaksStyle } : null
|
|
22774
23134
|
}),
|
|
22775
23135
|
timeframe: () => tf,
|
|
22776
23136
|
theme: () => deps.theme.get(),
|
|
22777
23137
|
dataStatus: () => symbolInfo?.dataStatus ?? null,
|
|
22778
23138
|
subsession: activeSubsession,
|
|
23139
|
+
hours: () => eff.symbol.session,
|
|
22779
23140
|
// The trading-hours setting is the one writer of the subsession, so a choice made anywhere is
|
|
22780
23141
|
// the viewer's setting, saved with the chart and undone with its history.
|
|
22781
23142
|
setSubsession: (active) => handle.applySettings({ symbol: { session: active } })
|
|
@@ -23139,6 +23500,7 @@ function createChartInstance(deps) {
|
|
|
23139
23500
|
side: () => scaleSide,
|
|
23140
23501
|
ratio: () => eff.priceScale.lockPriceToBarRatio ? eff.priceScale.priceToBarRatio : liveRatio(),
|
|
23141
23502
|
extendedHours: () => session2.extended(),
|
|
23503
|
+
tradingHours: () => session2.options(),
|
|
23142
23504
|
shortcut,
|
|
23143
23505
|
shown: (id) => commandShown(deps.access, id),
|
|
23144
23506
|
permitted: (id) => commandPermitted(deps.access, id),
|
|
@@ -23774,7 +24136,7 @@ function createChartInstance(deps) {
|
|
|
23774
24136
|
replay2.abandon();
|
|
23775
24137
|
replaySlice = null;
|
|
23776
24138
|
legend2.setHeader(symbol, tf);
|
|
23777
|
-
legend2.
|
|
24139
|
+
legend2.setStatus();
|
|
23778
24140
|
nameSymbol();
|
|
23779
24141
|
prices.sync();
|
|
23780
24142
|
paintAll();
|
|
@@ -23789,7 +24151,7 @@ function createChartInstance(deps) {
|
|
|
23789
24151
|
indicators2.recompute();
|
|
23790
24152
|
session2.adopt(info);
|
|
23791
24153
|
legend2.setHeader(symbol, tf);
|
|
23792
|
-
legend2.
|
|
24154
|
+
legend2.setStatus();
|
|
23793
24155
|
nameSymbol();
|
|
23794
24156
|
applyTimezone();
|
|
23795
24157
|
deps.onSymbolInfo(info);
|
|
@@ -24400,7 +24762,7 @@ function createChartInstance(deps) {
|
|
|
24400
24762
|
leavesMode = mode;
|
|
24401
24763
|
if (switched) viewerPartial = withoutModeLeaves(viewerPartial);
|
|
24402
24764
|
applyLook();
|
|
24403
|
-
legend2.
|
|
24765
|
+
legend2.setStatus();
|
|
24404
24766
|
if (switched) {
|
|
24405
24767
|
deps.contentChanged?.();
|
|
24406
24768
|
history2.changed();
|
|
@@ -25747,8 +26109,6 @@ var FLYOUT_WIDTH = {
|
|
|
25747
26109
|
layoutsSort: 234,
|
|
25748
26110
|
/** The zone list in the bottom bar, opening upward, with its check column. */
|
|
25749
26111
|
timezone: 251,
|
|
25750
|
-
/** The session choices beside it. */
|
|
25751
|
-
session: 176,
|
|
25752
26112
|
/** The replay row's starting-point choices, opening upward. */
|
|
25753
26113
|
replayStart: 177,
|
|
25754
26114
|
/** The replay row's update-timeframe list. The speed list opens at the same width and grows to
|
|
@@ -25758,6 +26118,8 @@ var FLYOUT_WIDTH = {
|
|
|
25758
26118
|
|
|
25759
26119
|
// src/ui/chrome/bottomBar.ts
|
|
25760
26120
|
var timezoneCommand = (id) => id === EXCHANGE_TIMEZONE ? "chart.timezone.exchange" : `chart.timezone.${id}`;
|
|
26121
|
+
var symbolSessionModel = (info) => info && typeof info.timezone === "string" && typeof info.session === "string" ? parseSessionModel(info) : null;
|
|
26122
|
+
var tradingHoursCommand = (option) => option.hours === "allHours" ? { id: "chart.settings.apply", arg: { settings: { symbol: { session: "allHours" } } } } : { id: `chart.subsession.${option.hours}` };
|
|
25761
26123
|
function mountBottomBar(deps) {
|
|
25762
26124
|
const t = () => deps.i18n.t;
|
|
25763
26125
|
const element = h("div", { class: "qc-bottombar", role: "toolbar", "aria-label": t()("chrome.bottomBar") });
|
|
@@ -25780,6 +26142,12 @@ function mountBottomBar(deps) {
|
|
|
25780
26142
|
let tzMenu = null;
|
|
25781
26143
|
let sessionMenu = null;
|
|
25782
26144
|
const zone = () => activeChart(deps).displayTimezone();
|
|
26145
|
+
const tradingHours = () => {
|
|
26146
|
+
const chart = activeChart(deps);
|
|
26147
|
+
const options2 = tradingHoursOptions(symbolSessionModel(chart.symbolInfo()));
|
|
26148
|
+
const hours = chart.subsession() === "regular" ? "regular" : chart.settings().symbol.session === "allHours" ? "allHours" : "extended";
|
|
26149
|
+
return { options: options2, active: tradingHoursOption(options2, hours) };
|
|
26150
|
+
};
|
|
25783
26151
|
const tick = () => {
|
|
25784
26152
|
const z = zone();
|
|
25785
26153
|
clock2.textContent = z ? formatClock(deps.i18n.tag(), z) : "";
|
|
@@ -25850,23 +26218,24 @@ function mountBottomBar(deps) {
|
|
|
25850
26218
|
anchor: sessionTrigger,
|
|
25851
26219
|
label: t()("chrome.session"),
|
|
25852
26220
|
className: "qc-session-menu",
|
|
25853
|
-
width: FLYOUT_WIDTH.session,
|
|
25854
26221
|
align: "end",
|
|
25855
26222
|
placement: "up",
|
|
25856
26223
|
build(body, handle) {
|
|
25857
|
-
const active =
|
|
26224
|
+
const { options: options2, active } = tradingHours();
|
|
25858
26225
|
body.appendChild(menuHeading(t()("chrome.sessionsHeading")));
|
|
25859
|
-
for (const option of
|
|
25860
|
-
|
|
26226
|
+
for (const option of options2) {
|
|
26227
|
+
const run = tradingHoursCommand(option);
|
|
26228
|
+
const chosen2 = option.hours === active?.hours;
|
|
26229
|
+
if (!chosen2 && !shows(deps, run.id)) continue;
|
|
25861
26230
|
body.appendChild(
|
|
25862
26231
|
menuItem({
|
|
25863
|
-
text:
|
|
26232
|
+
text: t()(option.label),
|
|
25864
26233
|
role: "menuitemradio",
|
|
25865
|
-
checked:
|
|
25866
|
-
disabled:
|
|
26234
|
+
checked: chosen2,
|
|
26235
|
+
disabled: !chosen2 && !deps.commands.available(run.id),
|
|
25867
26236
|
onSelect: () => {
|
|
25868
26237
|
handle.close();
|
|
25869
|
-
deps.commands.execute(
|
|
26238
|
+
deps.commands.execute(run.id, run.arg);
|
|
25870
26239
|
}
|
|
25871
26240
|
})
|
|
25872
26241
|
);
|
|
@@ -25883,7 +26252,8 @@ function mountBottomBar(deps) {
|
|
|
25883
26252
|
ranges,
|
|
25884
26253
|
...offeredRanges.filter((preset) => shows(deps, `chart.range.${preset.key}`)).map((preset) => {
|
|
25885
26254
|
const id = `chart.range.${preset.key}`;
|
|
25886
|
-
const
|
|
26255
|
+
const framed = { ...preset, tf: rangeTimeframe(preset.tf, deps.timeframes) };
|
|
26256
|
+
const chip = button2({ label: rangePresetName(t(), framed), tip: rangePresetTip(t(), framed), text: preset.key, className: "qc-toolbar-button qc-range-chip", pressed: chart.rangePreset() === preset.key, onClick: () => deps.commands.execute(id) });
|
|
25887
26257
|
setDisabled(chip, !deps.commands.available(id));
|
|
25888
26258
|
return chip;
|
|
25889
26259
|
})
|
|
@@ -25891,15 +26261,15 @@ function mountBottomBar(deps) {
|
|
|
25891
26261
|
ranges.setAttribute("aria-label", t()("command.rangeSet"));
|
|
25892
26262
|
element.setAttribute("aria-label", t()("chrome.bottomBar"));
|
|
25893
26263
|
name(tzTrigger, t()("timezone.title"));
|
|
26264
|
+
tip(tzTrigger, t()("timezone.tip"));
|
|
25894
26265
|
tick();
|
|
25895
|
-
const
|
|
25896
|
-
sessionTrigger.hidden =
|
|
25897
|
-
if (
|
|
25898
|
-
|
|
25899
|
-
|
|
25900
|
-
name(sessionTrigger, `${t()("chrome.session")}: ${label3}`);
|
|
26266
|
+
const hours = tradingHours();
|
|
26267
|
+
sessionTrigger.hidden = hours.options.length === 0;
|
|
26268
|
+
if (hours.active) {
|
|
26269
|
+
name(sessionTrigger, `${t()("chrome.session")}: ${t()(hours.active.label)}`);
|
|
26270
|
+
tip(sessionTrigger, t()(hours.active.label));
|
|
25901
26271
|
const text2 = sessionTrigger.querySelector(".qc-button-text");
|
|
25902
|
-
if (text2) text2.textContent =
|
|
26272
|
+
if (text2) text2.textContent = t()(hours.active.short);
|
|
25903
26273
|
}
|
|
25904
26274
|
tzMenu?.refresh();
|
|
25905
26275
|
sessionMenu?.refresh();
|
|
@@ -26278,7 +26648,7 @@ function openIndicatorPicker(deps) {
|
|
|
26278
26648
|
const status2 = h("div", { class: "qc-picker-status qc-secondary", role: "status", "aria-live": "polite" });
|
|
26279
26649
|
let pendingFocus = null;
|
|
26280
26650
|
const actionButton = (label3, content, run, disabled = false, focusKey, className = "qc-picker-action") => {
|
|
26281
|
-
const button3 = h("button", { type: "button", class: className, "aria-label": label3,
|
|
26651
|
+
const button3 = h("button", { type: "button", class: className, "aria-label": label3, "data-picker-focus": focusKey }, content ?? h("span", {}, label3));
|
|
26282
26652
|
button3.disabled = disabled;
|
|
26283
26653
|
button3.addEventListener("click", (event) => {
|
|
26284
26654
|
event.stopPropagation();
|
|
@@ -26342,10 +26712,11 @@ function openIndicatorPicker(deps) {
|
|
|
26342
26712
|
if (options2.favorite !== void 0) {
|
|
26343
26713
|
const toggleStar = actionButton(t(options2.favorite ? "picker.unfavorite" : "picker.favorite", { name: options2.title }), star(deps.icons, options2.favorite), () => toggle(options2.kind, options2.id, options2.favorite, options2.hostedFavorite === true), options2.hostedFavorite === true && (busy || loading) || !!source3 && !available, key("favorite"), "qc-picker-star");
|
|
26344
26714
|
toggleStar.setAttribute("aria-pressed", String(options2.favorite));
|
|
26715
|
+
toggleStar.dataset.qcTip = t(options2.favorite ? "picker.unfavoriteTip" : "picker.favoriteTip");
|
|
26345
26716
|
favoriteCell.append(toggleStar);
|
|
26346
26717
|
}
|
|
26347
26718
|
const label3 = options2.permitted ? options2.title : t("picker.notPermitted", { name: options2.title });
|
|
26348
|
-
const name2 = h("button", { type: "button", class: "qc-picker-name", "data-qc-item": "", tabindex: "-1", ...options2.builtin ? { "data-indicator": options2.id } : { "data-picker-item": options2.id }, "aria-label": options2.builtin && options2.permitted ? t("picker.add", { name: options2.title }) : label3,
|
|
26719
|
+
const name2 = h("button", { type: "button", class: "qc-picker-name", "data-qc-item": "", tabindex: "-1", ...options2.builtin ? { "data-indicator": options2.id } : { "data-picker-item": options2.id }, "aria-label": options2.builtin && options2.permitted ? t("picker.add", { name: options2.title }) : label3, "data-no-tip": "" }, options2.title);
|
|
26349
26720
|
name2.disabled = !options2.permitted;
|
|
26350
26721
|
name2.dataset.pickerFocus = key("primary");
|
|
26351
26722
|
if (name2.disabled) name2.setAttribute("aria-disabled", "true");
|
|
@@ -26902,6 +27273,7 @@ function buildSearchSurface(deps, box2, frame2) {
|
|
|
26902
27273
|
h("span", { class: "qc-search-more-chevron", "aria-hidden": "true" }, deps.icons.glyph(open2 ? ICONS.chevronUp : ICONS.chevronDown, { size: 16 }))
|
|
26903
27274
|
);
|
|
26904
27275
|
name(pill, t("search.moreListings", { count: others }));
|
|
27276
|
+
tip(pill, t(open2 ? "search.collapse" : "search.expand"));
|
|
26905
27277
|
pill.addEventListener("mousedown", (e) => e.preventDefault());
|
|
26906
27278
|
pill.addEventListener("click", (e) => {
|
|
26907
27279
|
e.stopPropagation();
|
|
@@ -26964,24 +27336,13 @@ function buildSearchSurface(deps, box2, frame2) {
|
|
|
26964
27336
|
)
|
|
26965
27337
|
);
|
|
26966
27338
|
if (compare && entry.added) {
|
|
26967
|
-
const mark = h("span", { class: "qc-search-added",
|
|
27339
|
+
const mark = h("span", { class: "qc-search-added", "data-qc-tip": t("search.addedMark", { symbol: label3.ticker }) });
|
|
26968
27340
|
mark.appendChild(deps.icons.glyph(ICONS.check, { size: 18 }));
|
|
26969
27341
|
option.appendChild(mark);
|
|
26970
27342
|
} else {
|
|
26971
27343
|
const source3 = h("span", { class: "qc-search-source" });
|
|
26972
27344
|
if (label3.source) source3.appendChild(h("span", { class: "qc-search-exchange" }, label3.source));
|
|
26973
27345
|
if (entry.members && r.group) source3.appendChild(groupPill(r.group, entry.members.length - 1, entry.open === true));
|
|
26974
|
-
if (label3.source) {
|
|
26975
|
-
const sourceMark = h("span", { class: "qc-search-mark", "aria-hidden": "true", title: label3.source });
|
|
26976
|
-
paintSource(r, label3.source, sourceMark);
|
|
26977
|
-
const venues = entry.members ? new Set(entry.members.map((m) => m.exchange).filter((x) => x !== "")) : null;
|
|
26978
|
-
if (venues && venues.size > 1) {
|
|
26979
|
-
const pile = h("span", { class: "qc-search-pile" });
|
|
26980
|
-
pile.append(pileEdges(), sourceMark);
|
|
26981
|
-
source3.appendChild(pile);
|
|
26982
|
-
} else source3.appendChild(sourceMark);
|
|
26983
|
-
}
|
|
26984
|
-
option.appendChild(source3);
|
|
26985
27346
|
if (compare) {
|
|
26986
27347
|
const actions2 = h("span", { class: "qc-search-actions" });
|
|
26987
27348
|
for (const p of PLACEMENTS2) {
|
|
@@ -26997,8 +27358,19 @@ function buildSearchSurface(deps, box2, frame2) {
|
|
|
26997
27358
|
})
|
|
26998
27359
|
);
|
|
26999
27360
|
}
|
|
27000
|
-
|
|
27361
|
+
source3.appendChild(actions2);
|
|
27001
27362
|
}
|
|
27363
|
+
if (label3.source) {
|
|
27364
|
+
const sourceMark = h("span", { class: "qc-search-mark", "aria-hidden": "true", ...label3.source ? { "data-qc-tip": label3.source } : {} });
|
|
27365
|
+
paintSource(r, label3.source, sourceMark);
|
|
27366
|
+
const venues = entry.members ? new Set(entry.members.map((m) => m.exchange).filter((x) => x !== "")) : null;
|
|
27367
|
+
if (venues && venues.size > 1) {
|
|
27368
|
+
const pile = h("span", { class: "qc-search-pile" });
|
|
27369
|
+
pile.append(pileEdges(), sourceMark);
|
|
27370
|
+
source3.appendChild(pile);
|
|
27371
|
+
} else source3.appendChild(sourceMark);
|
|
27372
|
+
}
|
|
27373
|
+
option.appendChild(source3);
|
|
27002
27374
|
}
|
|
27003
27375
|
option.addEventListener("click", () => act(entry));
|
|
27004
27376
|
children.push(option);
|
|
@@ -27124,7 +27496,7 @@ function mountToasts(grid2, deps) {
|
|
|
27124
27496
|
return {
|
|
27125
27497
|
push(kind, text2) {
|
|
27126
27498
|
const card = h("div", { class: "qc-overlay qc-toast", "data-qc-kind": kind }, h("span", { class: `qc-toast-text${kind === "error" ? " qc-negative" : ""}` }, text2));
|
|
27127
|
-
card.appendChild(button2({ label: t()("toast.dismiss"), icon: deps.icons.glyph(ICONS.close, { size: 18 }), className: "qc-toast-dismiss", onClick: () => dismiss(card) }));
|
|
27499
|
+
card.appendChild(button2({ label: t()("toast.dismiss"), noTip: true, icon: deps.icons.glyph(ICONS.close, { size: 18 }), className: "qc-toast-dismiss", onClick: () => dismiss(card) }));
|
|
27128
27500
|
list.appendChild(card);
|
|
27129
27501
|
timers.set(
|
|
27130
27502
|
card,
|
|
@@ -27140,6 +27512,185 @@ function mountToasts(grid2, deps) {
|
|
|
27140
27512
|
};
|
|
27141
27513
|
}
|
|
27142
27514
|
|
|
27515
|
+
// src/ui/chrome/tips.ts
|
|
27516
|
+
var TIP_DELAY = 400;
|
|
27517
|
+
var TIP_WARM = 600;
|
|
27518
|
+
var GAP2 = 4;
|
|
27519
|
+
var EDGE = 4;
|
|
27520
|
+
var EAR = 6;
|
|
27521
|
+
var CONTROL = 'button, [role="button"], [role="tab"], a[href]';
|
|
27522
|
+
function tipText(element) {
|
|
27523
|
+
if (element.hasAttribute("data-no-tip")) return null;
|
|
27524
|
+
const words = element.dataset.qcTip ?? element.getAttribute("aria-label") ?? "";
|
|
27525
|
+
const said = words.replace(/\s+/g, " ").trim();
|
|
27526
|
+
if (said === "") return null;
|
|
27527
|
+
const visible = (element.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
27528
|
+
return visible === said ? null : words.trim();
|
|
27529
|
+
}
|
|
27530
|
+
function tipTarget(target, surface) {
|
|
27531
|
+
let node = target instanceof Element ? target : null;
|
|
27532
|
+
while (node && surface.contains(node)) {
|
|
27533
|
+
if (node instanceof HTMLElement) {
|
|
27534
|
+
if (node.hasAttribute("data-qc-tip") || node.hasAttribute("data-no-tip")) return node;
|
|
27535
|
+
if (node.matches(CONTROL)) return node.hasAttribute("aria-label") ? node : null;
|
|
27536
|
+
}
|
|
27537
|
+
if (node === surface) break;
|
|
27538
|
+
node = node.parentElement;
|
|
27539
|
+
}
|
|
27540
|
+
return null;
|
|
27541
|
+
}
|
|
27542
|
+
function popupOpen(control) {
|
|
27543
|
+
return control.getAttribute("aria-expanded") === "true" && control.hasAttribute("aria-haspopup");
|
|
27544
|
+
}
|
|
27545
|
+
function tipZone(control) {
|
|
27546
|
+
if (control.closest('[role="toolbar"][aria-orientation="vertical"]')) return "side";
|
|
27547
|
+
if (control.closest(".qc-topbar, .qc-legend")) return "below";
|
|
27548
|
+
if (control.closest(".qc-bottombar")) return "above";
|
|
27549
|
+
return "auto";
|
|
27550
|
+
}
|
|
27551
|
+
var clamp = (value, low, high) => Math.max(low, Math.min(value, Math.max(low, high)));
|
|
27552
|
+
function placeTip(control, bubble, zone, bounds) {
|
|
27553
|
+
const centreX = (control.left + control.right) / 2;
|
|
27554
|
+
const centreY = (control.top + control.bottom) / 2;
|
|
27555
|
+
if (zone === "side") {
|
|
27556
|
+
const side2 = centreX <= (bounds.left + bounds.right) / 2 ? "right" : "left";
|
|
27557
|
+
const left2 = side2 === "right" ? control.right + GAP2 : control.left - GAP2 - bubble.width;
|
|
27558
|
+
const top2 = clamp(centreY - bubble.height / 2, bounds.top + EDGE, bounds.bottom - EDGE - bubble.height);
|
|
27559
|
+
return { left: left2, top: top2, side: side2, ear: clamp(centreY - top2, EAR, bubble.height - EAR) };
|
|
27560
|
+
}
|
|
27561
|
+
const above = control.top - GAP2 - bubble.height;
|
|
27562
|
+
const side = zone === "above" || zone === "auto" && above >= bounds.top + EDGE ? "top" : "bottom";
|
|
27563
|
+
const top = side === "top" ? above : control.bottom + GAP2;
|
|
27564
|
+
const left = clamp(centreX - bubble.width / 2, bounds.left + EDGE, bounds.right - EDGE - bubble.width);
|
|
27565
|
+
return { left, top, side, ear: clamp(centreX - left, EAR, bubble.width - EAR) };
|
|
27566
|
+
}
|
|
27567
|
+
function attachTips(layer) {
|
|
27568
|
+
const bubble = h("div", { class: "qc-tip", "aria-hidden": "true" });
|
|
27569
|
+
bubble.hidden = true;
|
|
27570
|
+
layer.appendChild(bubble);
|
|
27571
|
+
let current = null;
|
|
27572
|
+
let pressed = null;
|
|
27573
|
+
let timer = null;
|
|
27574
|
+
let warmUntil = 0;
|
|
27575
|
+
const releases = [];
|
|
27576
|
+
const clear = () => {
|
|
27577
|
+
if (timer) clearTimeout(timer);
|
|
27578
|
+
timer = null;
|
|
27579
|
+
};
|
|
27580
|
+
const hide = () => {
|
|
27581
|
+
clear();
|
|
27582
|
+
if (!bubble.hidden) warmUntil = Date.now() + TIP_WARM;
|
|
27583
|
+
bubble.hidden = true;
|
|
27584
|
+
current = null;
|
|
27585
|
+
};
|
|
27586
|
+
const show = (control) => {
|
|
27587
|
+
clear();
|
|
27588
|
+
const words = control.isConnected && !popupOpen(control) ? tipText(control) : null;
|
|
27589
|
+
if (!words) {
|
|
27590
|
+
hide();
|
|
27591
|
+
return;
|
|
27592
|
+
}
|
|
27593
|
+
bubble.textContent = words;
|
|
27594
|
+
bubble.hidden = false;
|
|
27595
|
+
bubble.style.visibility = "hidden";
|
|
27596
|
+
bubble.style.left = "0px";
|
|
27597
|
+
bubble.style.top = "0px";
|
|
27598
|
+
const size = bubble.getBoundingClientRect();
|
|
27599
|
+
const rect = control.getBoundingClientRect();
|
|
27600
|
+
const view = { left: 0, top: 0, right: window.innerWidth, bottom: window.innerHeight };
|
|
27601
|
+
const root = control.closest(".qc-root")?.getBoundingClientRect();
|
|
27602
|
+
const bounds = root && root.width > 0 && root.height > 0 ? { left: Math.max(view.left, root.left), top: Math.max(view.top, root.top), right: Math.min(view.right, root.right), bottom: Math.min(view.bottom, root.bottom) } : view;
|
|
27603
|
+
const placed = placeTip(rect, { width: size.width, height: size.height }, tipZone(control), bounds);
|
|
27604
|
+
bubble.dataset.qcSide = placed.side;
|
|
27605
|
+
bubble.style.left = `${Math.round(placed.left)}px`;
|
|
27606
|
+
bubble.style.top = `${Math.round(placed.top)}px`;
|
|
27607
|
+
bubble.style.setProperty("--qcd-tip-ear", `${Math.round(placed.ear)}px`);
|
|
27608
|
+
bubble.style.visibility = "";
|
|
27609
|
+
};
|
|
27610
|
+
const offer = (control) => {
|
|
27611
|
+
if (control === current) return;
|
|
27612
|
+
clear();
|
|
27613
|
+
const warm = !bubble.hidden || Date.now() < warmUntil;
|
|
27614
|
+
if (!bubble.hidden) bubble.hidden = true;
|
|
27615
|
+
current = control;
|
|
27616
|
+
if (warm) show(control);
|
|
27617
|
+
else timer = setTimeout(() => current === control && show(control), TIP_DELAY);
|
|
27618
|
+
};
|
|
27619
|
+
const onWindowBlur = () => hide();
|
|
27620
|
+
const onScroll = () => hide();
|
|
27621
|
+
window.addEventListener("blur", onWindowBlur);
|
|
27622
|
+
window.addEventListener("scroll", onScroll, true);
|
|
27623
|
+
const watch = (surface) => {
|
|
27624
|
+
surface.setAttribute("data-qc-tips", "");
|
|
27625
|
+
const onOver = (event) => {
|
|
27626
|
+
if (event.pointerType === "touch") {
|
|
27627
|
+
hide();
|
|
27628
|
+
return;
|
|
27629
|
+
}
|
|
27630
|
+
const control = tipTarget(event.target, surface);
|
|
27631
|
+
if (control && control === pressed) return;
|
|
27632
|
+
pressed = null;
|
|
27633
|
+
if (control) offer(control);
|
|
27634
|
+
else if (current) hide();
|
|
27635
|
+
};
|
|
27636
|
+
const onOut = (event) => {
|
|
27637
|
+
const next = event.relatedTarget;
|
|
27638
|
+
if (current && !(next instanceof Node && current.contains(next))) hide();
|
|
27639
|
+
if (pressed && !(next instanceof Node && pressed.contains(next))) pressed = null;
|
|
27640
|
+
};
|
|
27641
|
+
const onDown = (event) => {
|
|
27642
|
+
pressed = tipTarget(event.target, surface);
|
|
27643
|
+
hide();
|
|
27644
|
+
};
|
|
27645
|
+
const onFocus = (event) => {
|
|
27646
|
+
const target = event.target;
|
|
27647
|
+
if (!(target instanceof HTMLElement) || !target.closest(".qc-bottombar")) return;
|
|
27648
|
+
let visible = false;
|
|
27649
|
+
try {
|
|
27650
|
+
visible = target.matches(":focus-visible");
|
|
27651
|
+
} catch {
|
|
27652
|
+
visible = false;
|
|
27653
|
+
}
|
|
27654
|
+
const control = visible ? tipTarget(target, surface) : null;
|
|
27655
|
+
if (control) offer(control);
|
|
27656
|
+
};
|
|
27657
|
+
const onBlur = (event) => {
|
|
27658
|
+
if (current && event.target instanceof Node && current.contains(event.target)) hide();
|
|
27659
|
+
};
|
|
27660
|
+
surface.addEventListener("pointerover", onOver);
|
|
27661
|
+
surface.addEventListener("pointerout", onOut);
|
|
27662
|
+
surface.addEventListener("pointerdown", onDown, true);
|
|
27663
|
+
surface.addEventListener("focusin", onFocus);
|
|
27664
|
+
surface.addEventListener("focusout", onBlur);
|
|
27665
|
+
let released = false;
|
|
27666
|
+
const release = () => {
|
|
27667
|
+
if (released) return;
|
|
27668
|
+
released = true;
|
|
27669
|
+
surface.removeAttribute("data-qc-tips");
|
|
27670
|
+
surface.removeEventListener("pointerover", onOver);
|
|
27671
|
+
surface.removeEventListener("pointerout", onOut);
|
|
27672
|
+
surface.removeEventListener("pointerdown", onDown, true);
|
|
27673
|
+
surface.removeEventListener("focusin", onFocus);
|
|
27674
|
+
surface.removeEventListener("focusout", onBlur);
|
|
27675
|
+
if (current && surface.contains(current)) hide();
|
|
27676
|
+
};
|
|
27677
|
+
releases.push(release);
|
|
27678
|
+
return release;
|
|
27679
|
+
};
|
|
27680
|
+
return {
|
|
27681
|
+
element: bubble,
|
|
27682
|
+
watch,
|
|
27683
|
+
hide,
|
|
27684
|
+
destroy() {
|
|
27685
|
+
for (const release of releases.splice(0)) release();
|
|
27686
|
+
hide();
|
|
27687
|
+
window.removeEventListener("blur", onWindowBlur);
|
|
27688
|
+
window.removeEventListener("scroll", onScroll, true);
|
|
27689
|
+
bubble.remove();
|
|
27690
|
+
}
|
|
27691
|
+
};
|
|
27692
|
+
}
|
|
27693
|
+
|
|
27143
27694
|
// src/ui/chrome/layoutCatalog.ts
|
|
27144
27695
|
function createLayoutCatalog(deps) {
|
|
27145
27696
|
let rows2 = null;
|
|
@@ -27587,6 +28138,7 @@ function mountLayoutSetup(deps) {
|
|
|
27587
28138
|
const code = projected.arrangement;
|
|
27588
28139
|
trigger.querySelector(".qc-arrangement")?.replaceWith(arrangementGlyph(code, deps.icons));
|
|
27589
28140
|
name(trigger, `${t()("layouts.setup")}: ${arrangementName(t(), code, arrangementOf(code)?.label ?? code)}`);
|
|
28141
|
+
tip(trigger, t()("layouts.setup"));
|
|
27590
28142
|
const drawn2 = parts();
|
|
27591
28143
|
trigger.hidden = !drawn2.grid && !drawn2.switches;
|
|
27592
28144
|
if (trigger.hidden) menu2?.close();
|
|
@@ -27858,11 +28410,10 @@ function mountLayoutsMenu(deps) {
|
|
|
27858
28410
|
nameLabel.dataset.qcNotSaving = String(notSaving());
|
|
27859
28411
|
saveLink.textContent = t()("layouts.save");
|
|
27860
28412
|
saveLink.hidden = !offer;
|
|
27861
|
-
title
|
|
28413
|
+
tip(title, t()(state === "layouts.allSaved" ? "layouts.allSaved" : "layouts.save"));
|
|
27862
28414
|
title.setAttribute("aria-label", offer ? t()("layouts.saveLayout") : `${currentName()}: ${t()(state)}`);
|
|
27863
28415
|
title.setAttribute("aria-disabled", String(!offer));
|
|
27864
28416
|
trigger.setAttribute("aria-label", t()("layouts.manage"));
|
|
27865
|
-
trigger.title = t()("layouts.manage");
|
|
27866
28417
|
trigger.hidden = !MENU_COMMANDS.some((id) => shows(deps, id));
|
|
27867
28418
|
if (trigger.hidden) menu2?.close();
|
|
27868
28419
|
};
|
|
@@ -27911,6 +28462,7 @@ function mountSettingsMenu(deps) {
|
|
|
27911
28462
|
element: trigger,
|
|
27912
28463
|
sync() {
|
|
27913
28464
|
name(trigger, t()("settings.menu"));
|
|
28465
|
+
tip(trigger, t()("chrome.settingsTip"));
|
|
27914
28466
|
},
|
|
27915
28467
|
destroy() {
|
|
27916
28468
|
stop();
|
|
@@ -27989,6 +28541,7 @@ function mountStylePicker(deps) {
|
|
|
27989
28541
|
const style = activeChart(deps).style();
|
|
27990
28542
|
trigger.querySelector(".qc-icon")?.replaceWith(deps.icons.glyph(STYLE_ICONS[style]));
|
|
27991
28543
|
name(trigger, `${t()("chrome.chartStyle")}: ${commandLabel(deps, `chart.style.${style}`)}`);
|
|
28544
|
+
tip(trigger, commandLabel(deps, `chart.style.${style}`));
|
|
27992
28545
|
trigger.hidden = !groups.flat().some((other) => other !== style && listedStyle(other, style));
|
|
27993
28546
|
menu2?.refresh();
|
|
27994
28547
|
};
|
|
@@ -28109,7 +28662,7 @@ function buildTimeframeComposer(model) {
|
|
|
28109
28662
|
let unitOpen = false;
|
|
28110
28663
|
const countInput = h("input", { class: "qc-tf-count-input", inputmode: "numeric", "aria-label": t("timeframe.customCount"), value: count2 });
|
|
28111
28664
|
const step = (label3, className, delta) => {
|
|
28112
|
-
const b = h("button", { type: "button", class: `qc-tf-spin ${className}`, "aria-label": label3, tabindex: "-1" }, model.icons.glyph(ICONS.chevronDown, { size: 18 }));
|
|
28665
|
+
const b = h("button", { type: "button", class: `qc-tf-spin ${className}`, "aria-label": label3, "data-no-tip": "", tabindex: "-1" }, model.icons.glyph(ICONS.chevronDown, { size: 18 }));
|
|
28113
28666
|
b.addEventListener("click", () => {
|
|
28114
28667
|
count2 = String(Math.min(TIMEFRAME_MAX[unit], Math.max(1, (Number(count2) || 0) + delta)));
|
|
28115
28668
|
countInput.value = count2;
|
|
@@ -28120,7 +28673,7 @@ function buildTimeframeComposer(model) {
|
|
|
28120
28673
|
const spinner = h("span", { class: "qc-tf-spin-column" }, step(t("timeframe.increment"), "qc-tf-spin-up", 1), step(t("timeframe.decrement"), "qc-tf-spin-down", -1));
|
|
28121
28674
|
const countField = h("div", { class: "qc-tf-count" }, countInput, spinner);
|
|
28122
28675
|
const unitLabel = h("span", { class: "qc-tf-unit-label" }, t(TIMEFRAME_UNIT_NAME[unit]));
|
|
28123
|
-
const unitButton = h("button", { type: "button", class: "qc-tf-unit", "aria-haspopup": "listbox", "aria-expanded": "false", "aria-label": t("timeframe.customUnit") }, unitLabel, model.icons.glyph(ICONS.chevronDown, { size: 18, className: "qc-tf-unit-caret" }));
|
|
28676
|
+
const unitButton = h("button", { type: "button", class: "qc-tf-unit", "aria-haspopup": "listbox", "aria-expanded": "false", "aria-label": t("timeframe.customUnit"), "data-no-tip": "" }, unitLabel, model.icons.glyph(ICONS.chevronDown, { size: 18, className: "qc-tf-unit-caret" }));
|
|
28124
28677
|
const unitList = h("div", { class: "qc-tf-unit-list", role: "listbox", "aria-label": t("timeframe.customUnit") });
|
|
28125
28678
|
const closeUnit = () => {
|
|
28126
28679
|
if (!unitOpen) return;
|
|
@@ -28170,7 +28723,7 @@ function buildTimeframeComposer(model) {
|
|
|
28170
28723
|
const validate = () => {
|
|
28171
28724
|
const tk = token();
|
|
28172
28725
|
setDisabled(add, tk === null || existing() || refused());
|
|
28173
|
-
add.
|
|
28726
|
+
add.dataset.qcTip = tk !== null && existing() ? t("timeframe.exists", { timeframe: timeframeLabel(t, tk) }) : t("timeframe.addCustom");
|
|
28174
28727
|
};
|
|
28175
28728
|
const submit = () => {
|
|
28176
28729
|
const tk = token();
|
|
@@ -28221,6 +28774,7 @@ function mountTimeframePicker(deps) {
|
|
|
28221
28774
|
...list.filter((token) => listed(token, active)).map((token) => {
|
|
28222
28775
|
const chip = button2({
|
|
28223
28776
|
label: timeframeLabel(t(), token),
|
|
28777
|
+
tip: timeframeTip(t(), token),
|
|
28224
28778
|
text: timeframeChipLabel(token),
|
|
28225
28779
|
className: "qc-toolbar-button qc-tf-chip",
|
|
28226
28780
|
pressed: token === active,
|
|
@@ -28232,6 +28786,7 @@ function mountTimeframePicker(deps) {
|
|
|
28232
28786
|
);
|
|
28233
28787
|
chips.setAttribute("aria-label", t()("timeframe.title"));
|
|
28234
28788
|
name(caret, t()("timeframe.all"));
|
|
28789
|
+
tip(caret, t()("timeframe.intervalTip"));
|
|
28235
28790
|
const candidates = deps.timeframes.list ?? [...TIMEFRAME_PRESET_TOKENS, ...deps.store.custom()];
|
|
28236
28791
|
const hidden = candidates.filter((token) => !listed(token, active));
|
|
28237
28792
|
const shape = `${active}|${saved.join(",")}|${deps.store.custom().join(",")}|${[...collapsed].join(",")}|${hidden.join(",")}`;
|
|
@@ -28495,6 +29050,7 @@ function mountTopBar(deps) {
|
|
|
28495
29050
|
};
|
|
28496
29051
|
const named2 = (control, change, carrier, id) => {
|
|
28497
29052
|
name(control, change ? t()(carrier, { change: t()(HISTORY_CHANGE_LABELS[change]) }) : commandLabel(deps, id));
|
|
29053
|
+
tip(control, commandLabel(deps, id));
|
|
28498
29054
|
};
|
|
28499
29055
|
const sync = () => {
|
|
28500
29056
|
const chart = activeChart(deps);
|
|
@@ -28503,16 +29059,19 @@ function mountTopBar(deps) {
|
|
|
28503
29059
|
const text2 = pill.querySelector(".qc-button-text");
|
|
28504
29060
|
if (text2) text2.textContent = symbolNames(chart.symbolInfo() ?? chart.symbol()).mark;
|
|
28505
29061
|
name(pill, `${t()("chrome.symbolSearch")}: ${t()("chrome.activeChart", { symbol: chart.symbol(), timeframe: chart.timeframe() })}`);
|
|
29062
|
+
tip(pill, t()("chrome.symbolSearch"));
|
|
28506
29063
|
pill.hidden = !shows(deps, "chart.symbol.set");
|
|
28507
29064
|
setDisabled(pill, !commands.available("chart.symbol.set") || !deps.widget.capabilities().search);
|
|
28508
29065
|
}
|
|
28509
29066
|
if (compareDoor) {
|
|
28510
29067
|
name(compareDoor, t()("chrome.compare"));
|
|
29068
|
+
tip(compareDoor, t()("chrome.compareTip"));
|
|
28511
29069
|
compareDoor.hidden = !shows(deps, "chart.compare.open");
|
|
28512
29070
|
setDisabled(compareDoor, !commands.available("chart.compare.open"));
|
|
28513
29071
|
}
|
|
28514
29072
|
if (indicators2) {
|
|
28515
29073
|
name(indicators2, t()("chrome.indicators"));
|
|
29074
|
+
tip(indicators2, t()("chrome.indicatorsTip"));
|
|
28516
29075
|
label3(indicators2, t()("chrome.indicators"));
|
|
28517
29076
|
indicators2.hidden = !shows(deps, "chart.indicators.open");
|
|
28518
29077
|
setDisabled(indicators2, !commands.available("chart.indicators.open"));
|
|
@@ -28536,6 +29095,7 @@ function mountTopBar(deps) {
|
|
|
28536
29095
|
if (fullscreen) {
|
|
28537
29096
|
const active = deps.widget.fullscreen.active();
|
|
28538
29097
|
name(fullscreen, commandLabel(deps, active ? "widget.fullscreen.exit" : "widget.fullscreen.enter"));
|
|
29098
|
+
tip(fullscreen, t()("chrome.fullscreenTip"));
|
|
28539
29099
|
fullscreen.setAttribute("aria-pressed", String(active));
|
|
28540
29100
|
fullscreen.querySelector(".qc-icon")?.replaceWith(deps.icons.glyph(active ? ICONS.exitFullscreen : ICONS.fullscreen));
|
|
28541
29101
|
fullscreen.hidden = !shows(deps, "widget.fullscreen.toggle");
|
|
@@ -28543,6 +29103,7 @@ function mountTopBar(deps) {
|
|
|
28543
29103
|
}
|
|
28544
29104
|
if (image) {
|
|
28545
29105
|
name(image, t()("chrome.image"));
|
|
29106
|
+
tip(image, t()("chrome.imageTip"));
|
|
28546
29107
|
const drawn2 = imageRows2();
|
|
28547
29108
|
image.hidden = drawn2.length === 0;
|
|
28548
29109
|
if (image.hidden) imageMenu?.close();
|
|
@@ -28700,12 +29261,12 @@ function openDatePicker(deps) {
|
|
|
28700
29261
|
build(box2, dialog) {
|
|
28701
29262
|
const chosen2 = () => parseYmd(text2);
|
|
28702
29263
|
const title = h("div", { class: "qc-date-title" }, h("span", { class: "qc-date-title-text" }, t("replay.selectDate")));
|
|
28703
|
-
const close = h("button", { type: "button", class: "qc-button qc-dialog-close", "aria-label": t("replay.close"),
|
|
29264
|
+
const close = h("button", { type: "button", class: "qc-button qc-dialog-close", "aria-label": t("replay.close"), "data-no-tip": "" }, deps.icons.glyph(ICONS.dialogClose, { size: 18 }));
|
|
28704
29265
|
close.addEventListener("click", () => dialog.close());
|
|
28705
29266
|
const dateField = h("input", { type: "text", class: "qc-field qc-date-field", "aria-label": t("replay.startDateField"), placeholder: t("replay.dateMask"), spellcheck: "false", autocomplete: "off", value: text2 });
|
|
28706
29267
|
const dateBox = h("span", { class: "qc-date-box" }, dateField, deps.icons.glyph(ICONS.calendarDays, { className: "qc-date-box-mark" }));
|
|
28707
29268
|
const timeField = deps.withTime ? h("input", { type: "text", class: "qc-field qc-date-time", role: "combobox", "aria-label": t("replay.startTimeField"), "aria-haspopup": "listbox", "aria-expanded": "false", "aria-controls": listId, "aria-autocomplete": "none", placeholder: t("replay.timeMask"), spellcheck: "false", autocomplete: "off", value: time }) : null;
|
|
28708
|
-
const clock2 = timeField ? h("button", { type: "button", class: "qc-date-box-mark qc-date-clock", tabindex: "-1", "aria-label": t("replay.chooseTime")
|
|
29269
|
+
const clock2 = timeField ? h("button", { type: "button", class: "qc-date-box-mark qc-date-clock", tabindex: "-1", "aria-label": t("replay.chooseTime") }, deps.icons.glyph(ICONS.clock)) : null;
|
|
28709
29270
|
const timeBox = timeField && clock2 ? h("span", { class: "qc-date-box" }, timeField, clock2) : null;
|
|
28710
29271
|
const previous = h("button", { type: "button", class: "qc-button qc-date-step" }, deps.icons.glyph(ICONS.chevronLeft));
|
|
28711
29272
|
const heading = h("button", { type: "button", class: "qc-button qc-date-heading" });
|
|
@@ -29271,7 +29832,7 @@ function mountReplayTransport(deps) {
|
|
|
29271
29832
|
onClose: () => open2.delete(menu2),
|
|
29272
29833
|
build(body, menu3) {
|
|
29273
29834
|
const heading = menuHeading(t()("replay.timeframe"));
|
|
29274
|
-
heading.
|
|
29835
|
+
heading.dataset.qcTip = t()("replay.timeframeHelp");
|
|
29275
29836
|
body.appendChild(heading);
|
|
29276
29837
|
const current = handle.replay.timeframe();
|
|
29277
29838
|
const rows2 = [];
|
|
@@ -29413,11 +29974,12 @@ function mountReplayTransport(deps) {
|
|
|
29413
29974
|
|
|
29414
29975
|
// src/ui/settings/form.ts
|
|
29415
29976
|
var NAMED_WIDTHS = { 100: "short", 150: "medium", 180: "wide" };
|
|
29416
|
-
function tipButton(deps,
|
|
29417
|
-
const text2 =
|
|
29977
|
+
function tipButton(deps, tip2) {
|
|
29978
|
+
const text2 = tip2.kind === "hint" ? tip2.text : tip2.title;
|
|
29418
29979
|
const b = el("button", { type: "button", class: "qc-settings-tip", "aria-label": text2 });
|
|
29419
|
-
b.appendChild(deps.icons.glyph(
|
|
29420
|
-
if (
|
|
29980
|
+
b.appendChild(deps.icons.glyph(tip2.kind === "hint" ? ICONS.question : ICONS.info, { size: 18 }));
|
|
29981
|
+
if (tip2.kind === "hint") {
|
|
29982
|
+
b.setAttribute("data-no-tip", "");
|
|
29421
29983
|
let line3 = null;
|
|
29422
29984
|
let untrack = null;
|
|
29423
29985
|
const hide = () => {
|
|
@@ -29428,7 +29990,7 @@ function tipButton(deps, tip) {
|
|
|
29428
29990
|
};
|
|
29429
29991
|
const show = () => {
|
|
29430
29992
|
if (line3 || !b.isConnected) return;
|
|
29431
|
-
line3 = el("div", { class: "qc-settings-tooltip", role: "tooltip", text:
|
|
29993
|
+
line3 = el("div", { class: "qc-settings-tooltip", role: "tooltip", text: tip2.text });
|
|
29432
29994
|
deps.layer.appendChild(line3);
|
|
29433
29995
|
const a = b.getBoundingClientRect();
|
|
29434
29996
|
const left = Math.max(4, Math.min(a.left + a.width / 2 - line3.offsetWidth / 2, window.innerWidth - line3.offsetWidth - 4));
|
|
@@ -29440,7 +30002,7 @@ function tipButton(deps, tip) {
|
|
|
29440
30002
|
b.addEventListener("pointerleave", hide);
|
|
29441
30003
|
b.addEventListener("focus", show);
|
|
29442
30004
|
b.addEventListener("blur", hide);
|
|
29443
|
-
if (
|
|
30005
|
+
if (tip2.href) b.addEventListener("click", () => window.open(tip2.href, "_blank", "noopener"));
|
|
29444
30006
|
return b;
|
|
29445
30007
|
}
|
|
29446
30008
|
let close = null;
|
|
@@ -29453,11 +30015,11 @@ function tipButton(deps, tip) {
|
|
|
29453
30015
|
}
|
|
29454
30016
|
const card = el(
|
|
29455
30017
|
"div",
|
|
29456
|
-
{ class: "qc-settings-card", role: "dialog", "aria-label":
|
|
29457
|
-
el("div", { class: "qc-settings-card-title", text:
|
|
29458
|
-
el("div", { class: "qc-settings-card-body", text:
|
|
30018
|
+
{ class: "qc-settings-card", role: "dialog", "aria-label": tip2.title },
|
|
30019
|
+
el("div", { class: "qc-settings-card-title", text: tip2.title }),
|
|
30020
|
+
el("div", { class: "qc-settings-card-body", text: tip2.body })
|
|
29459
30021
|
);
|
|
29460
|
-
if (
|
|
30022
|
+
if (tip2.href) card.appendChild(el("a", { class: "qc-settings-card-link", href: tip2.href, target: "_blank", rel: "noopener", text: deps.t("settings.learnMore") }));
|
|
29461
30023
|
close = openPopover(deps.layer, b, card, "below", () => {
|
|
29462
30024
|
close = null;
|
|
29463
30025
|
}, b, void 0, { gap: 4, className: "qc-settings-card-popover" });
|
|
@@ -29648,9 +30210,9 @@ function createSettingsForm(page, deps) {
|
|
|
29648
30210
|
page.appendChild(element);
|
|
29649
30211
|
}
|
|
29650
30212
|
};
|
|
29651
|
-
const labelCell = (content,
|
|
30213
|
+
const labelCell = (content, tip2) => {
|
|
29652
30214
|
const cell2 = el("div", { class: "qc-drawing-row-label qc-settings-label" }, ...content);
|
|
29653
|
-
if (
|
|
30215
|
+
if (tip2) cell2.appendChild(tipButton(deps, tip2));
|
|
29654
30216
|
return cell2;
|
|
29655
30217
|
};
|
|
29656
30218
|
const checkbox2 = (id, label3, checked, disabled, onChange) => {
|
|
@@ -29914,29 +30476,30 @@ function symbolPage(form, ctx) {
|
|
|
29914
30476
|
const symbol = settings2.symbol;
|
|
29915
30477
|
const setSymbol = (leaves) => ctx.apply({ symbol: leaves });
|
|
29916
30478
|
form.heading(t("settings.headingDataModification"));
|
|
29917
|
-
|
|
30479
|
+
const chosen2 = tradingHoursOption(ctx.tradingHours, symbol.session);
|
|
30480
|
+
if (ctx.intraday && chosen2) {
|
|
29918
30481
|
form.field({
|
|
29919
30482
|
id: "session",
|
|
29920
30483
|
label: t("settings.session"),
|
|
29921
30484
|
controls: (c) => c.select({
|
|
29922
|
-
value:
|
|
29923
|
-
options:
|
|
29924
|
-
|
|
29925
|
-
{ value: "extended", label: t("settings.sessionExtended") },
|
|
29926
|
-
{ value: "allHours", label: t("settings.sessionAllHours") }
|
|
29927
|
-
],
|
|
29928
|
-
width: 150,
|
|
30485
|
+
value: chosen2.hours,
|
|
30486
|
+
options: ctx.tradingHours.map((option) => ({ value: option.hours, label: t(option.label) })),
|
|
30487
|
+
width: ctx.electronic ? 200 : 150,
|
|
29929
30488
|
onChange: (session2) => setSymbol({ session: session2 })
|
|
29930
30489
|
})
|
|
29931
30490
|
});
|
|
29932
|
-
if (
|
|
30491
|
+
if (chosen2.hours !== "regular") {
|
|
29933
30492
|
form.field({
|
|
29934
30493
|
id: "sessionBackground",
|
|
29935
|
-
label: t(
|
|
30494
|
+
label: t(ctx.electronic ? "settings.electronicHoursBackground" : chosen2.hours === "allHours" ? "settings.allHoursBackground" : "settings.extendedHoursBackground"),
|
|
29936
30495
|
controls: (c) => {
|
|
30496
|
+
if (ctx.electronic) {
|
|
30497
|
+
c.color({ color: symbol.electronicColor, onColor: (electronicColor) => setSymbol({ electronicColor }), opacity: true, label: t("settings.electronic") });
|
|
30498
|
+
return;
|
|
30499
|
+
}
|
|
29937
30500
|
c.color({ color: symbol.preMarketColor, onColor: (preMarketColor) => setSymbol({ preMarketColor }), opacity: true, label: t("settings.preMarket") });
|
|
29938
30501
|
c.color({ color: symbol.postMarketColor, onColor: (postMarketColor) => setSymbol({ postMarketColor }), opacity: true, label: t("settings.postMarket") });
|
|
29939
|
-
if (
|
|
30502
|
+
if (chosen2.hours === "allHours") c.color({ color: symbol.nightColor, onColor: (nightColor) => setSymbol({ nightColor }), opacity: true, label: t("settings.night") });
|
|
29940
30503
|
}
|
|
29941
30504
|
});
|
|
29942
30505
|
}
|
|
@@ -30326,7 +30889,7 @@ var PAGE_ICONS = {
|
|
|
30326
30889
|
canvas: ICONS.settingsCanvas,
|
|
30327
30890
|
events: ICONS.settingsEvents
|
|
30328
30891
|
};
|
|
30329
|
-
var
|
|
30892
|
+
var EDGE2 = 20;
|
|
30330
30893
|
var nextDialogId2 = 0;
|
|
30331
30894
|
var isRecord = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
30332
30895
|
function viewerSettings(chart) {
|
|
@@ -30395,6 +30958,7 @@ function createChartSettingsDialog(deps) {
|
|
|
30395
30958
|
const pageContext = (s) => {
|
|
30396
30959
|
const chart = s.chart;
|
|
30397
30960
|
const zones = deps.timezones ?? null;
|
|
30961
|
+
const model = symbolSessionModel(chart.symbolInfo());
|
|
30398
30962
|
return {
|
|
30399
30963
|
t: t(),
|
|
30400
30964
|
locale: deps.i18n.tag(),
|
|
@@ -30410,6 +30974,8 @@ function createChartSettingsDialog(deps) {
|
|
|
30410
30974
|
},
|
|
30411
30975
|
intraday: isIntradayTimeframe(chart.timeframe()),
|
|
30412
30976
|
extendedHours: chart.hasExtendedHours(),
|
|
30977
|
+
tradingHours: tradingHoursOptions(model),
|
|
30978
|
+
electronic: model?.electronic ?? false,
|
|
30413
30979
|
indicators: chart.indicators.get().length > 0,
|
|
30414
30980
|
prices: deps.widget.capabilities().prices,
|
|
30415
30981
|
accent: deps.widget.theme.get()["state.accent"]
|
|
@@ -30502,7 +31068,7 @@ function createChartSettingsDialog(deps) {
|
|
|
30502
31068
|
const rect = box2.getBoundingClientRect();
|
|
30503
31069
|
left = rect.left;
|
|
30504
31070
|
top = rect.top;
|
|
30505
|
-
if (top + height > viewport.height -
|
|
31071
|
+
if (top + height > viewport.height - EDGE2) top = Math.max(EDGE2, viewport.height - EDGE2 - height);
|
|
30506
31072
|
}
|
|
30507
31073
|
box2.style.position = "fixed";
|
|
30508
31074
|
box2.style.left = `${Math.round(left)}px`;
|
|
@@ -30632,7 +31198,7 @@ function createChartSettingsDialog(deps) {
|
|
|
30632
31198
|
button({
|
|
30633
31199
|
class: "qc-drawing-star",
|
|
30634
31200
|
label: t()("drawing.removeTemplateNamed", { name: saved.name }),
|
|
30635
|
-
|
|
31201
|
+
tip: t()("drawing.remove"),
|
|
30636
31202
|
icon: deps.icons.icon("trash", 18),
|
|
30637
31203
|
onClick: () => {
|
|
30638
31204
|
s.closeMenu?.();
|
|
@@ -30778,7 +31344,6 @@ function createChartSettingsDialog(deps) {
|
|
|
30778
31344
|
for (const [b, key] of [[s.cancel, "drawing.cancel"], [s.ok, "drawing.ok"]]) {
|
|
30779
31345
|
b.textContent = t()(key);
|
|
30780
31346
|
b.setAttribute("aria-label", t()(key));
|
|
30781
|
-
b.title = t()(key);
|
|
30782
31347
|
}
|
|
30783
31348
|
render(s);
|
|
30784
31349
|
},
|
|
@@ -30842,6 +31407,8 @@ function mountChrome(deps) {
|
|
|
30842
31407
|
root.appendChild(overlays);
|
|
30843
31408
|
const ctx = { i18n, commands: widget.commands, overlays, widget, icons: deps.icons, styles: deps.styles, timeframes: deps.timeframes, layouts: deps.layouts, access: deps.access, builtInIndicators: deps.builtInIndicators, ranges: deps.ranges, timezones: deps.timezones };
|
|
30844
31409
|
const disposers = [];
|
|
31410
|
+
const tips = attachTips(deps.layer);
|
|
31411
|
+
disposers.push(tips.watch(root), tips.watch(deps.layer), () => tips.destroy());
|
|
30845
31412
|
let disposed = false;
|
|
30846
31413
|
let searchDialog = null;
|
|
30847
31414
|
let searchOwner = createSearchSessionOwner(deps.datafeed, { pageSize: 50 });
|
|
@@ -30952,6 +31519,7 @@ function mountChrome(deps) {
|
|
|
30952
31519
|
paintThemeRoot(surface, widget.theme.mode(), widget.theme.get());
|
|
30953
31520
|
surface.setAttribute("dir", readingDirection(i18n));
|
|
30954
31521
|
deps.drawingToolbarContainer.appendChild(surface);
|
|
31522
|
+
disposers.push(tips.watch(surface));
|
|
30955
31523
|
const releasePanelHost = bindPanelHost(surface, deps.layer);
|
|
30956
31524
|
let active = widget.activeChart();
|
|
30957
31525
|
deps.mountDrawingToolbar?.(active, surface);
|
|
@@ -31010,6 +31578,7 @@ function mountChrome(deps) {
|
|
|
31010
31578
|
surface.setAttribute("dir", readingDirection(i18n));
|
|
31011
31579
|
surface.appendChild(topBar.element);
|
|
31012
31580
|
deps.toolbarContainer.appendChild(surface);
|
|
31581
|
+
disposers.push(tips.watch(surface));
|
|
31013
31582
|
const shortcuts = attachShortcuts({ root: surface, commands: widget.commands });
|
|
31014
31583
|
disposers.push(
|
|
31015
31584
|
() => shortcuts.dispose(),
|
|
@@ -31670,6 +32239,8 @@ function openSymbolSearch(options2) {
|
|
|
31670
32239
|
overlays.className = "qc-overlays";
|
|
31671
32240
|
layer.appendChild(overlays);
|
|
31672
32241
|
(options2.container ?? document.body).appendChild(layer);
|
|
32242
|
+
const tips = attachTips(layer);
|
|
32243
|
+
tips.watch(layer);
|
|
31673
32244
|
const shared = options2.cache ? owners.get(options2.cache) : void 0;
|
|
31674
32245
|
const owner = shared ?? createSearchSessionOwner(options2.datafeed);
|
|
31675
32246
|
let gone = false;
|
|
@@ -31677,6 +32248,7 @@ function openSymbolSearch(options2) {
|
|
|
31677
32248
|
if (gone) return;
|
|
31678
32249
|
gone = true;
|
|
31679
32250
|
if (!shared) owner.dispose();
|
|
32251
|
+
tips.destroy();
|
|
31680
32252
|
layer.remove();
|
|
31681
32253
|
options2.onClose?.();
|
|
31682
32254
|
};
|
|
@@ -31798,10 +32370,13 @@ function openTimeframePicker(options2) {
|
|
|
31798
32370
|
overlays.className = "qc-overlays";
|
|
31799
32371
|
layer.appendChild(overlays);
|
|
31800
32372
|
(options2.container ?? document.body).appendChild(layer);
|
|
32373
|
+
const tips = attachTips(layer);
|
|
32374
|
+
tips.watch(layer);
|
|
31801
32375
|
let gone = false;
|
|
31802
32376
|
const teardown = () => {
|
|
31803
32377
|
if (gone) return;
|
|
31804
32378
|
gone = true;
|
|
32379
|
+
tips.destroy();
|
|
31805
32380
|
layer.remove();
|
|
31806
32381
|
options2.onClose?.();
|
|
31807
32382
|
};
|
|
@@ -31969,6 +32544,7 @@ export {
|
|
|
31969
32544
|
createSymbolSearchCache,
|
|
31970
32545
|
createThemeController,
|
|
31971
32546
|
createUdfDatafeed,
|
|
32547
|
+
dataStatusNotice,
|
|
31972
32548
|
drawingContextKey,
|
|
31973
32549
|
effectivePlotColor,
|
|
31974
32550
|
emptyDrawingDocument,
|
|
@@ -31998,7 +32574,9 @@ export {
|
|
|
31998
32574
|
makeTickMarkFormatter,
|
|
31999
32575
|
manifestInputDefaults,
|
|
32000
32576
|
marketStatus,
|
|
32577
|
+
marketStatusCountdown,
|
|
32001
32578
|
marketStatusFor,
|
|
32579
|
+
marketStatusSentence,
|
|
32002
32580
|
marketStatusText,
|
|
32003
32581
|
marketStatusTitle,
|
|
32004
32582
|
matchSegments,
|
|
@@ -32053,6 +32631,8 @@ export {
|
|
|
32053
32631
|
timezoneLabel,
|
|
32054
32632
|
timezoneListing,
|
|
32055
32633
|
toolName,
|
|
32634
|
+
tradingHoursOption,
|
|
32635
|
+
tradingHoursOptions,
|
|
32056
32636
|
tzOffsetLabel,
|
|
32057
32637
|
tzOffsetMinutes,
|
|
32058
32638
|
udfPriceFormat,
|