@daoyi/nmtl-ui 2.0.1-beta.133 → 2.0.1-beta.135

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.
Files changed (62) hide show
  1. package/README.md +45 -45
  2. package/lib/components/{Autocomplete-0ea4a31c.js → Autocomplete-e40d7145.js} +4 -4
  3. package/lib/components/Autocomplete.js +4 -4
  4. package/lib/components/Avatar.js +1 -1
  5. package/lib/components/BackTop.js +2 -2
  6. package/lib/components/BarChart.js +1 -1
  7. package/lib/components/Breadcrumbs.js +20 -9
  8. package/lib/components/{Button-7bd5aa09.js → Button-8cf35bc0.js} +1 -1
  9. package/lib/components/Button.js +2 -2
  10. package/lib/components/Carousel.js +1 -1
  11. package/lib/components/CollapseContent.js +46 -4
  12. package/lib/components/{ContactModal-159de99c.js → ContactModal-19979528.js} +37 -24
  13. package/lib/components/ContactModal.js +8 -8
  14. package/lib/components/{Drawer-a5be9257.js → Drawer-b770014f.js} +6 -4
  15. package/lib/components/Drawer.js +5 -5
  16. package/lib/components/Dropdown.js +1 -1
  17. package/lib/components/{Empty-c6a44967.js → Empty-48685dd0.js} +1 -1
  18. package/lib/components/Empty.js +2 -2
  19. package/lib/components/ExportButton.js +1 -1
  20. package/lib/components/{ExtraTools-2691c13e.js → ExtraTools-c46c1965.js} +3 -3
  21. package/lib/components/ExtraTools.js +3 -3
  22. package/lib/components/Filter.js +2 -2
  23. package/lib/components/Footer.js +8 -8
  24. package/lib/components/{ForwardLink-5fbd2705.js → ForwardLink-2905563c.js} +2 -2
  25. package/lib/components/ForwardLink.js +3 -3
  26. package/lib/components/Header.js +8 -8
  27. package/lib/components/Image.js +1 -1
  28. package/lib/components/Input.js +1 -1
  29. package/lib/components/InputMethod.js +186 -196
  30. package/lib/components/{KeywordSearch-db9c45d9.js → KeywordSearch-4e621ded.js} +5 -5
  31. package/lib/components/KeywordSearch.js +5 -5
  32. package/lib/components/KeywordTicker.js +3 -3
  33. package/lib/components/Keywords.js +5 -5
  34. package/lib/components/Loading.js +1 -1
  35. package/lib/components/MUITheme.js +2 -2
  36. package/lib/components/{Modal-e04532fa.js → Modal-b984f381.js} +3 -3
  37. package/lib/components/Modal.js +4 -4
  38. package/lib/components/{MoreButton-19055e07.js → MoreButton-0b5aaef3.js} +2 -2
  39. package/lib/components/MoreButton.js +2 -2
  40. package/lib/components/Pagination.js +2 -2
  41. package/lib/components/SNA.js +11 -11
  42. package/lib/components/{SegmentedControl-81f63afc.js → SegmentedControl-804da0a6.js} +1 -1
  43. package/lib/components/SegmentedControl.js +2 -2
  44. package/lib/components/{Select-89841c71.js → Select-979f7e73.js} +2 -2
  45. package/lib/components/Select.js +3 -3
  46. package/lib/components/{Spin-8f87eadc.js → Spin-07679812.js} +1 -1
  47. package/lib/components/Spin.js +2 -2
  48. package/lib/components/{Tooltip-6ebfa9c1.js → Tooltip-bbbaa9c7.js} +1 -1
  49. package/lib/components/Tooltip.js +2 -2
  50. package/lib/components/globalConfig.js +19 -4
  51. package/lib/utils/arrayMerge.js +20 -20
  52. package/lib/utils/convert2HtmlEntities.js +5 -1
  53. package/lib/utils/exportXlsx.js +1 -1
  54. package/lib/utils/index.d.ts +2 -0
  55. package/lib/utils/index.js +2 -0
  56. package/lib/utils/newWindowHint-db113a69.js +49 -0
  57. package/lib/utils/prepareTimelineData.js +78 -0
  58. package/lib/utils/syncTimelineA11y.js +53 -0
  59. package/package.json +1 -1
  60. /package/lib/components/{createSvgIcon-dc603596.js → createSvgIcon-370e163a.js} +0 -0
  61. /package/lib/components/{index-b76a85f4.js → index-c33afcb5.js} +0 -0
  62. /package/lib/components/{index-b47819f3.js → index-ff95f719.js} +0 -0
@@ -1,11 +1,11 @@
1
- export { M as default } from './Modal-e04532fa.js';
1
+ export { M as default } from './Modal-b984f381.js';
2
2
  import 'react';
3
- import './index-b76a85f4.js';
3
+ import './index-c33afcb5.js';
4
4
  import 'prop-types';
5
5
  import '@material-ui/core';
6
6
  import '@material-ui/icons';
7
- import './Button-7bd5aa09.js';
7
+ import './Button-8cf35bc0.js';
8
8
  import './_rollupPluginBabelHelpers-a52356f6.js';
9
9
  import './style-inject.es-1f59c1d0.js';
10
- import './Spin-8f87eadc.js';
10
+ import './Spin-07679812.js';
11
11
  import './globalConfig';
@@ -1,7 +1,7 @@
1
1
  import { a as _slicedToArray } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { c as classNames } from './index-b76a85f4.js';
4
+ import { c as classNames } from './index-c33afcb5.js';
5
5
  import { ExpandLess, ExpandMore } from '@material-ui/icons';
6
6
  import { getIntl } from './globalConfig';
7
7
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
@@ -59,7 +59,7 @@ var MoreButton = function MoreButton(props) {
59
59
  }) : message;
60
60
  return (
61
61
  /*#__PURE__*/
62
- /* WCAG 2.1.1/4.1.2 看更多為互動元件:role="button" + tabIndex + 鍵盤操作,
62
+ /* WCAG 2.1.1/4.1.2 看更多為互動元件:role="button" + tabIndex + 鍵盤操作,
63
63
  報讀補「點選後載入更多結果」預先提示、aria-expanded 表達展開狀態 */
64
64
  React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
65
65
  "aria-live": "polite",
@@ -1,8 +1,8 @@
1
- export { M as default } from './MoreButton-19055e07.js';
1
+ export { M as default } from './MoreButton-0b5aaef3.js';
2
2
  import './_rollupPluginBabelHelpers-a52356f6.js';
3
3
  import 'react';
4
4
  import 'prop-types';
5
- import './index-b76a85f4.js';
5
+ import './index-c33afcb5.js';
6
6
  import '@material-ui/icons';
7
7
  import './globalConfig';
8
8
  import './style-inject.es-1f59c1d0.js';
@@ -3,7 +3,7 @@ import * as React$2 from 'react';
3
3
  import React__default, { Children, isValidElement, cloneElement, useState, useRef, useEffect } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { k as _objectWithoutProperties, q as _slicedToArray, _ as _extends, r as _objectWithoutPropertiesLoose, u as alpha, j as formatMuiErrorMessage } from './defaultTheme-c5dd0f64.js';
6
- import { u as useControlled, c as clsx, b as useEventCallback, w as withStyles, d as useIsFocusVisible, e as useForkRef, f as createSvgIcon, g as capitalize, h as debounce, r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-dc603596.js';
6
+ import { u as useControlled, c as clsx, b as useEventCallback, w as withStyles, d as useIsFocusVisible, e as useForkRef, f as createSvgIcon, g as capitalize, h as debounce, r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-370e163a.js';
7
7
  import 'react-is';
8
8
  import '@material-ui/styles';
9
9
  import './withTheme-3486f38b.js';
@@ -11,7 +11,7 @@ import { _ as _toConsumableArray } from './toConsumableArray-c268c112.js';
11
11
  import { u as useTheme } from './useTheme-98b6cf17.js';
12
12
  import * as ReactDOM from 'react-dom';
13
13
  import ReactDOM__default from 'react-dom';
14
- import { c as classNames } from './index-b76a85f4.js';
14
+ import { c as classNames } from './index-c33afcb5.js';
15
15
  import { IconButton } from '@material-ui/core';
16
16
  import { getIntl } from './globalConfig';
17
17
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
@@ -1,14 +1,14 @@
1
1
  import React__default, { useMemo, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { c as classNames } from './index-b76a85f4.js';
3
+ import { c as classNames } from './index-c33afcb5.js';
4
4
  import { s as select, c as creator, e as event, d as dispatch, a as customEvent, D as DragEvent, q as quadtree, m as map, t as timer, T as Transform, i as identity, b as interrupt, o as ordinal, f as category10 } from './transform-849a452c.js';
5
- import { E as ExtraTools } from './ExtraTools-2691c13e.js';
5
+ import { E as ExtraTools } from './ExtraTools-c46c1965.js';
6
6
  import { getIntl } from './globalConfig';
7
7
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
8
8
  import './_rollupPluginBabelHelpers-a52356f6.js';
9
9
  import './_commonjsHelpers-70de2c37.js';
10
10
  import '@material-ui/core';
11
- import './Tooltip-6ebfa9c1.js';
11
+ import './Tooltip-bbbaa9c7.js';
12
12
  import './dataExport-a9e3fae1.js';
13
13
 
14
14
  function d3Create(name) {
@@ -1405,7 +1405,7 @@ styleInject(css_248z);
1405
1405
 
1406
1406
  /* eslint-disable indent */
1407
1407
 
1408
- /* 每張 svg 對應的 force simulation:重設、資料變更、卸載時要停掉,
1408
+ /* 每張 svg 對應的 force simulation:重設、資料變更、卸載時要停掉,
1409
1409
  否則舊圖已移除,simulation 仍在背景 tick(原本 renderSNA 從未停止舊的) */
1410
1410
  var simulations = new WeakMap();
1411
1411
  var stopSimulation = function stopSimulation(svgNode) {
@@ -1487,7 +1487,7 @@ var SNA = function SNA(props) {
1487
1487
  d.fy = event.y > contentHeight - 10 || event.y < 20 ? d.y : event.y;
1488
1488
  }
1489
1489
 
1490
- /* 效能:拖曳結束讓模擬降溫停下(d3 慣例);節點仍固定在放開的位置(fx/fy 不清除,維持原行為)。
1490
+ /* 效能:拖曳結束讓模擬降溫停下(d3 慣例);節點仍固定在放開的位置(fx/fy 不清除,維持原行為)。
1491
1491
  原本沒有 end:alphaTarget 停在 0.3,拖過一次模擬就永遠不會結束,每個 tick 持續重排整張圖 */
1492
1492
  function dragended() {
1493
1493
  if (!event.active) simulation.alphaTarget(0);
@@ -1539,10 +1539,10 @@ var SNA = function SNA(props) {
1539
1539
  return nodeRadius + 5;
1540
1540
  }).strength(1).iterations(10)).force('x', x(contentWidth / 2)).force('y', y(contentHeight / 2)).force('radial', radial(100, contentWidth / 1.5, contentHeight / 1.5));
1541
1541
 
1542
- /* 效能:SVG 先建在未掛上文件的節點,全部節點/標籤/連線建好後才一次掛進 #sna-graph(見 init 結尾)。
1543
- Adobe Fonts 動態子集 kit(目前實際只有 ra 的 index.html 載入)在 body 掛 MutationObserver,
1544
- 每筆 mutation 都用 TreeWalker 重掃目標整棵子樹收集文字;d3 逐一 append 進 live DOM 時,
1545
- 每加一個節點就產生一筆以父層 <g> 為目標的紀錄 → O(n²),ra 1,428 個節點首次載入主執行緒凍結 39–73 秒。
1542
+ /* 效能:SVG 先建在未掛上文件的節點,全部節點/標籤/連線建好後才一次掛進 #sna-graph(見 init 結尾)。
1543
+ Adobe Fonts 動態子集 kit(目前實際只有 ra 的 index.html 載入)在 body 掛 MutationObserver,
1544
+ 每筆 mutation 都用 TreeWalker 重掃目標整棵子樹收集文字;d3 逐一 append 進 live DOM 時,
1545
+ 每加一個節點就產生一筆以父層 <g> 為目標的紀錄 → O(n²),ra 1,428 個節點首次載入主執行緒凍結 39–73 秒。
1546
1546
  離線建好再掛上,kit 只收到一筆紀錄、只掃一次 */
1547
1547
  var svg = d3Create('svg').attr('viewBox', [0, 0, contentWidth, contentHeight]).style('background-color', backgroundColor);
1548
1548
  svg.append('defs').append('marker').attr('id', 'arrowhead').attr('viewBox', arrowViewBox).attr('refX', nodeRadius * 2 + nodeRadius * arrowPercent).attr('refY', 0).attr('orient', 'auto').attr('markerWidth', nodeRadius * (1 + arrowPercent)).attr('markerHeight', nodeRadius * (1 + arrowPercent)).attr('xoverflow', 'visible').append('svg:path').attr('d', arrowPath).attr('fill', '#999').style('stroke', 'none');
@@ -1573,7 +1573,7 @@ var SNA = function SNA(props) {
1573
1573
  type: d.type
1574
1574
  }) : null;
1575
1575
  })
1576
- /* WCAG 2.1.1/2.4.7 可互動節點支援鍵盤(實測回饋 R11):tabindex 可聚焦
1576
+ /* WCAG 2.1.1/2.4.7 可互動節點支援鍵盤(實測回饋 R11):tabindex 可聚焦
1577
1577
  (焦點框由各專案全域 :focus-visible 提供)、role=link+aria-label 報讀、Enter 觸發 */.attr('tabindex', function (d) {
1578
1578
  return d.hasClick ? 0 : null;
1579
1579
  }).attr('role', function (d) {
@@ -1601,7 +1601,7 @@ var SNA = function SNA(props) {
1601
1601
  return d.name;
1602
1602
  });
1603
1603
 
1604
- /* 效能:邊標籤(textPath)只為有文字的連線建立。edgepath 的 d 每個 tick 都重寫,瀏覽器就得重排所有參照它的 textPath;
1604
+ /* 效能:邊標籤(textPath)只為有文字的連線建立。edgepath 的 d 每個 tick 都重寫,瀏覽器就得重排所有參照它的 textPath;
1605
1605
  各站組出的連線多半沒有 property(ra 預設 1,437 條全空),原本每個 tick 白白重排上千個空標籤 */
1606
1606
  var labeledLinks = links.filter(function (d) {
1607
1607
  return d.property !== undefined && d.property !== null && "".concat(d.property).trim() !== '';
@@ -1,7 +1,7 @@
1
1
  import { b as _objectSpread2 } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { c as classNames } from './index-b76a85f4.js';
4
+ import { c as classNames } from './index-c33afcb5.js';
5
5
  import { o as getContrastRatio } from './defaultTheme-c5dd0f64.js';
6
6
  import 'react-is';
7
7
  import '@material-ui/styles';
@@ -1,8 +1,8 @@
1
- export { S as default } from './SegmentedControl-81f63afc.js';
1
+ export { S as default } from './SegmentedControl-804da0a6.js';
2
2
  import './_rollupPluginBabelHelpers-a52356f6.js';
3
3
  import 'react';
4
4
  import 'prop-types';
5
- import './index-b76a85f4.js';
5
+ import './index-c33afcb5.js';
6
6
  import './defaultTheme-c5dd0f64.js';
7
7
  import 'react-is';
8
8
  import '@material-ui/styles';
@@ -1,14 +1,14 @@
1
1
  import { b as _objectSpread2, d as _typeof } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { c as classNames } from './index-b76a85f4.js';
4
+ import { c as classNames } from './index-c33afcb5.js';
5
5
  import { FormControl, Select as Select$1, CircularProgress, MenuItem } from '@material-ui/core';
6
6
  import './defaultTheme-c5dd0f64.js';
7
7
  import 'react-is';
8
8
  import '@material-ui/styles';
9
9
  import { u as useTheme } from './useTheme-98b6cf17.js';
10
10
  import './withTheme-3486f38b.js';
11
- import { E as Empty } from './Empty-c6a44967.js';
11
+ import { E as Empty } from './Empty-48685dd0.js';
12
12
  import { getIntl } from './globalConfig';
13
13
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
14
14
 
@@ -1,14 +1,14 @@
1
- export { S as default } from './Select-89841c71.js';
1
+ export { S as default } from './Select-979f7e73.js';
2
2
  import './_rollupPluginBabelHelpers-a52356f6.js';
3
3
  import 'react';
4
4
  import 'prop-types';
5
- import './index-b76a85f4.js';
5
+ import './index-c33afcb5.js';
6
6
  import '@material-ui/core';
7
7
  import './defaultTheme-c5dd0f64.js';
8
8
  import 'react-is';
9
9
  import '@material-ui/styles';
10
10
  import './useTheme-98b6cf17.js';
11
11
  import './withTheme-3486f38b.js';
12
- import './Empty-c6a44967.js';
12
+ import './Empty-48685dd0.js';
13
13
  import './style-inject.es-1f59c1d0.js';
14
14
  import './globalConfig';
@@ -1,6 +1,6 @@
1
1
  import React__default, { useMemo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { c as classNames } from './index-b76a85f4.js';
3
+ import { c as classNames } from './index-c33afcb5.js';
4
4
  import { Fade, CircularProgress } from '@material-ui/core';
5
5
  import { getIntl } from './globalConfig';
6
6
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
@@ -1,7 +1,7 @@
1
- export { S as default } from './Spin-8f87eadc.js';
1
+ export { S as default } from './Spin-07679812.js';
2
2
  import 'react';
3
3
  import 'prop-types';
4
- import './index-b76a85f4.js';
4
+ import './index-c33afcb5.js';
5
5
  import '@material-ui/core';
6
6
  import './globalConfig';
7
7
  import './style-inject.es-1f59c1d0.js';
@@ -2,7 +2,7 @@ import React__default from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Tooltip as Tooltip$1 } from '@material-ui/core';
4
4
  import { _ as _extends } from './_rollupPluginBabelHelpers-a52356f6.js';
5
- import { c as classNames } from './index-b76a85f4.js';
5
+ import { c as classNames } from './index-c33afcb5.js';
6
6
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
7
7
 
8
8
  const TooltipContent = /*#__PURE__*/React__default.forwardRef((props, ref) => /*#__PURE__*/React__default.createElement("div", _extends({}, props, {
@@ -1,7 +1,7 @@
1
- export { T as default, p as placements } from './Tooltip-6ebfa9c1.js';
1
+ export { T as default, p as placements } from './Tooltip-bbbaa9c7.js';
2
2
  import 'react';
3
3
  import 'prop-types';
4
4
  import '@material-ui/core';
5
5
  import './_rollupPluginBabelHelpers-a52356f6.js';
6
- import './index-b76a85f4.js';
6
+ import './index-c33afcb5.js';
7
7
  import './style-inject.es-1f59c1d0.js';
@@ -29,6 +29,8 @@ var zhtw = {
29
29
  "common.content": "內容",
30
30
  "common.click.refresh": "點擊刷新",
31
31
  "common.provide.information": "我要補充資料",
32
+ "common.form.required": "(必填)",
33
+ "common.form.requiredNote": "標示「(必填)」的欄位必須填寫。",
32
34
  "common.form.name": "姓名",
33
35
  "common.form.phone": "電話",
34
36
  "common.form.age": "年齡",
@@ -61,6 +63,7 @@ var zhtw = {
61
63
  "aria.header.menuOpen": "開啟主選單",
62
64
  "aria.header.menuClose": "關閉主選單",
63
65
  "header.language": "語言",
66
+ "aria.breadcrumbs": "麵包屑",
64
67
  "aria.header.logoHome": "回首頁",
65
68
  "aria.header.logoHomeWithTitle": "{title},回首頁",
66
69
  "aria.header.navigation": "主選單",
@@ -68,6 +71,8 @@ var zhtw = {
68
71
  "aria.autocomplete.search": "執行搜尋",
69
72
  "aria.loading": "載入中",
70
73
  "aria.modal.close": "關閉視窗",
74
+ "chronology.videoThumbnail": "{title}影片截圖",
75
+ "chronology.watchVideo": "觀看影片",
71
76
  "aria.newWindow": "(另開新視窗)",
72
77
  "aria.vcode.image": "驗證碼圖片,如無法辨識可刷新驗證碼",
73
78
  "aria.vcode.refresh": "刷新驗證碼",
@@ -158,6 +163,8 @@ var zhcn = {
158
163
  "common.content": "内容",
159
164
  "common.click.refresh": "点击刷新",
160
165
  "common.provide.information": "我要补充资料",
166
+ "common.form.required": "(必填)",
167
+ "common.form.requiredNote": "标示「(必填)」的栏位必须填写。",
161
168
  "common.form.name": "姓名",
162
169
  "common.form.phone": "电话",
163
170
  "common.form.age": "年龄",
@@ -188,6 +195,7 @@ var zhcn = {
188
195
  "aria.header.menuOpen": "开启主选单",
189
196
  "aria.header.menuClose": "关闭主选单",
190
197
  "header.language": "语言",
198
+ "aria.breadcrumbs": "面包屑",
191
199
  "aria.header.logoHome": "回首页",
192
200
  "aria.header.logoHomeWithTitle": "{title},回首页",
193
201
  "aria.header.navigation": "主选单",
@@ -195,6 +203,8 @@ var zhcn = {
195
203
  "aria.autocomplete.search": "执行搜寻",
196
204
  "aria.loading": "载入中",
197
205
  "aria.modal.close": "关闭视窗",
206
+ "chronology.videoThumbnail": "{title}影片截图",
207
+ "chronology.watchVideo": "观看影片",
198
208
  "aria.newWindow": "(另开新视窗)",
199
209
  "aria.vcode.image": "验证码图片,如无法辨识可刷新验证码",
200
210
  "aria.vcode.refresh": "刷新验证码",
@@ -287,6 +297,8 @@ var enus = {
287
297
  "common.content": "Content",
288
298
  "common.click.refresh": "Click to refresh",
289
299
  "common.provide.information": "I want to add information",
300
+ "common.form.required": " (required)",
301
+ "common.form.requiredNote": "Fields marked “(required)” must be filled in.",
290
302
  "common.form.name": "Name",
291
303
  "common.form.phone": "Phone",
292
304
  "common.form.age": "Age",
@@ -317,6 +329,7 @@ var enus = {
317
329
  "aria.header.menuOpen": "Open main menu",
318
330
  "aria.header.menuClose": "Close main menu",
319
331
  "header.language": "Language",
332
+ "aria.breadcrumbs": "Breadcrumb",
320
333
  "aria.header.logoHome": "Back to home",
321
334
  "aria.header.logoHomeWithTitle": "{title}, back to home",
322
335
  "aria.header.navigation": "Main menu",
@@ -324,6 +337,8 @@ var enus = {
324
337
  "aria.autocomplete.search": "Search",
325
338
  "aria.loading": "Loading",
326
339
  "aria.modal.close": "Close dialog",
340
+ "chronology.videoThumbnail": "Screenshot of the video: {title}",
341
+ "chronology.watchVideo": "Watch the video",
327
342
  "aria.newWindow": " (opens in new window)",
328
343
  "aria.vcode.image": "CAPTCHA image, refresh if unreadable",
329
344
  "aria.vcode.refresh": "Refresh CAPTCHA",
@@ -404,9 +419,9 @@ var ZH_TW = 'zh-tw';
404
419
  var ZH_CN = 'zh-cn';
405
420
  var EN_US = 'en-us';
406
421
 
407
- /**
408
- * 全域i18n
409
- * 讓元件擁有自己的i18n
422
+ /**
423
+ * 全域i18n
424
+ * 讓元件擁有自己的i18n
410
425
  */
411
426
  var lang;
412
427
  var languages = (_languages = {}, _defineProperty(_languages, ZH_TW, zhtw), _defineProperty(_languages, ZH_CN, zhcn), _defineProperty(_languages, EN_US, enus), _languages);
@@ -418,7 +433,7 @@ var getIntl = function getIntl() {
418
433
  getLocale: function getLocale() {
419
434
  return lang;
420
435
  },
421
- /* 支援 {var} 佔位符代入(R30):原本只查表不代入,
436
+ /* 支援 {var} 佔位符代入(R30):原本只查表不代入,
422
437
  「第 {page} 頁」會被報讀軟體直接唸成「第page頁」 */
423
438
  formatMessage: function formatMessage(_ref, values) {
424
439
  var id = _ref.id;
@@ -4891,26 +4891,26 @@ var arrayMergeTimeline = function arrayMergeTimeline(input, keys, mergeKeys) {
4891
4891
  }, []);
4892
4892
  };
4893
4893
 
4894
- /**
4895
- * arrayMergeBySingleKey 函式功能說明。
4896
- * 根據 id 合併其它所有鍵值為 array
4897
- *
4898
- * params example:
4899
- * arrayMergeBySingleKey(data, 'id', {
4900
- * targetKeys: ['oriImgUrl'],
4901
- * newMergedKeys: ['oriImgUrls'],
4902
- * isShowIndex: true,
4903
- * omitKeys: ['oriImgUrl'],
4904
- * })
4905
- *
4906
- * @param {Array} input - 傳入的data。
4907
- * @param {String} sameKey - data中相同的key(id)。
4908
- * @param {Object} targetKeys {Array} - 欲merge的key。
4909
- * newMergedKeys {Array} - merged後的新key名稱【與targetKeys位置對應】
4910
- * isShowIndex {Boolean} - 該筆data是否顯示index
4911
- * omitKeys {Array} - 移除此筆data中的key
4912
- * @return {[object]} 回傳範例:
4913
- * [{id:1,source:["賴和"],images:[{image:xxxxxxx},{image:xxxxxxx}]},{id:2,source:"賴和",images:[{image:xxxxxxx},{image:xxxxxxx}]}]。
4894
+ /**
4895
+ * arrayMergeBySingleKey 函式功能說明。
4896
+ * 根據 id 合併其它所有鍵值為 array
4897
+ *
4898
+ * params example:
4899
+ * arrayMergeBySingleKey(data, 'id', {
4900
+ * targetKeys: ['oriImgUrl'],
4901
+ * newMergedKeys: ['oriImgUrls'],
4902
+ * isShowIndex: true,
4903
+ * omitKeys: ['oriImgUrl'],
4904
+ * })
4905
+ *
4906
+ * @param {Array} input - 傳入的data。
4907
+ * @param {String} sameKey - data中相同的key(id)。
4908
+ * @param {Object} targetKeys {Array} - 欲merge的key。
4909
+ * newMergedKeys {Array} - merged後的新key名稱【與targetKeys位置對應】
4910
+ * isShowIndex {Boolean} - 該筆data是否顯示index
4911
+ * omitKeys {Array} - 移除此筆data中的key
4912
+ * @return {[object]} 回傳範例:
4913
+ * [{id:1,source:["賴和"],images:[{image:xxxxxxx},{image:xxxxxxx}]},{id:2,source:"賴和",images:[{image:xxxxxxx},{image:xxxxxxx}]}]。
4914
4914
  */
4915
4915
  var arrayMergeBySingleKey = function arrayMergeBySingleKey(input, sameKey, _ref) {
4916
4916
  var targetKeys = _ref.targetKeys,
@@ -1,3 +1,6 @@
1
+ import { a as addNewWindowHint } from './newWindowHint-db113a69.js';
2
+ import '../components/globalConfig';
3
+
1
4
  var HtmlToReactParser = require('html-to-react').Parser;
2
5
  var htmlToReactParser = new HtmlToReactParser();
3
6
 
@@ -36,7 +39,8 @@ var md = require('markdown-it')({
36
39
  // eslint-disable-next-line import/prefer-default-export
37
40
  var convert2HtmlEntities = function convert2HtmlEntities(text) {
38
41
  if (text === undefined) return '';
39
- return htmlToReactParser.parse(md.render(text));
42
+ /* 後台文稿裡 target="_blank" 的連結,連結文字補「(另開新視窗)」(HM1240404E,2026-10-07) */
43
+ return htmlToReactParser.parse(addNewWindowHint(md.render(text)));
40
44
  };
41
45
 
42
46
  export { convert2HtmlEntities as default };
@@ -183,7 +183,7 @@ var worksSlider = function worksSlider(data) {
183
183
  });
184
184
  };
185
185
 
186
- /* \u532F\u51FA\u6A94\u540D\u7684\u65E5\u671F\u5F8C\u7DB4\uFF08YYYY-MM-DD\uFF09\uFF0C
186
+ /* \u532F\u51FA\u6A94\u540D\u7684\u65E5\u671F\u5F8C\u7DB4\uFF08YYYY-MM-DD\uFF09\uFF0C
187
187
  \u8207 DownloadMenu \u4E0B\u8F09\u5716\u7247\u5171\u7528 */
188
188
  var exportDateSuffix = function exportDateSuffix() {
189
189
  var now = new Date();
@@ -11,3 +11,5 @@ export { default as historyAppendSearch } from './historyAppendSearch';
11
11
  export { default as sendEmail } from './sendEmail';
12
12
  export { default as chunkArray } from './chunkArray';
13
13
  export { default as arrayMerge } from './arrayMerge';
14
+ export { default as prepareTimelineData } from './prepareTimelineData';
15
+ export { default as syncTimelineA11y } from './syncTimelineA11y';
@@ -11,3 +11,5 @@ export { default as historyAppendSearch } from './historyAppendSearch';
11
11
  export { default as sendEmail } from './sendEmail';
12
12
  export { default as chunkArray } from './chunkArray';
13
13
  export { default as arrayMerge } from './arrayMerge';
14
+ export { default as prepareTimelineData } from './prepareTimelineData';
15
+ export { default as syncTimelineA11y } from './syncTimelineA11y';
@@ -0,0 +1,49 @@
1
+ import { getIntl } from '../components/globalConfig';
2
+
3
+ /*
4
+ * 在 HTML 字串裡另開新視窗的連結文字後面補「(另開新視窗)」
5
+ * (數位部人工檢測 HM1240404E,2026-10-07:要直接寫在連結文字上,不能只放 title)。
6
+ * convert2HtmlEntities 與時間軸資料處理共用;不對外匯出。
7
+ */
8
+ var HINT_CLASS = 'newwindow-hint';
9
+ var hasHint = function hasHint(text) {
10
+ return /另開新視窗|另开新窗口|new window/i.test(text);
11
+ };
12
+ var newWindowHintText = function newWindowHintText() {
13
+ return getIntl().formatMessage({
14
+ id: 'aria.newWindow'
15
+ });
16
+ };
17
+
18
+ /**
19
+ * @param {string} html
20
+ * @param {object} [options]
21
+ * @param {boolean} [options.treatMissingTargetAsBlank] 沒寫 target 的連結也當成另開新視窗
22
+ * (@daoyi/timeline 的 DOMPurify 會把它們強制改成 _blank)
23
+ * @param {string} [options.className] 提示 span 的 class
24
+ */
25
+ var addNewWindowHint = function addNewWindowHint(html) {
26
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
27
+ _ref$treatMissingTarg = _ref.treatMissingTargetAsBlank,
28
+ treatMissingTargetAsBlank = _ref$treatMissingTarg === void 0 ? false : _ref$treatMissingTarg,
29
+ _ref$className = _ref.className,
30
+ className = _ref$className === void 0 ? HINT_CLASS : _ref$className;
31
+ if (typeof html !== 'string' || html.indexOf('<a') === -1 || typeof DOMParser === 'undefined') return html;
32
+ var doc = new DOMParser().parseFromString("<body>".concat(html, "</body>"), 'text/html');
33
+ var hint = newWindowHintText();
34
+ var changed = false;
35
+ doc.body.querySelectorAll('a[href]').forEach(function (a) {
36
+ var target = (a.getAttribute('target') || (treatMissingTargetAsBlank ? '_blank' : '')).toLowerCase();
37
+ if (target !== '_blank') return;
38
+ if (!a.getAttribute('rel')) a.setAttribute('rel', 'noopener noreferrer');
39
+ if (hasHint(a.textContent)) return;
40
+ var span = doc.createElement('span');
41
+ span.className = className;
42
+ span.textContent = hint;
43
+ a.appendChild(span);
44
+ changed = true;
45
+ });
46
+ return changed ? doc.body.innerHTML : html;
47
+ };
48
+
49
+ export { addNewWindowHint as a, newWindowHintText as n };
@@ -0,0 +1,78 @@
1
+ import { d as _objectSpread2, b as _slicedToArray } from './_rollupPluginBabelHelpers-9802e640.js';
2
+ import { getIntl } from '../components/globalConfig';
3
+ import { a as addNewWindowHint, n as newWindowHintText } from './newWindowHint-db113a69.js';
4
+
5
+ var TIMELINE_HINT_CLASS = 'tl-newwindow-hint';
6
+
7
+ /* https://drive.google.com/file/d/{id}/preview(或 /view) */
8
+ var DRIVE_FILE = /^https?:\/\/drive\.google\.com\/file\/d\/([\w-]+)/i;
9
+ /* 套件以網址結尾判斷是不是圖片(MediaType.js 的 /(jpg|...)(\?.*)?$/);縮圖網址沒有副檔名,
10
+ 補 #.jpg 讓它走圖片類型(# 之後不會送到伺服器) */
11
+ var driveThumbnail = function driveThumbnail(id) {
12
+ return "https://drive.google.com/thumbnail?id=".concat(id, "&sz=w1000#.jpg");
13
+ };
14
+ var driveView = function driveView(id) {
15
+ return "https://drive.google.com/file/d/".concat(id, "/view");
16
+ };
17
+ var stripTags = function stripTags(html) {
18
+ return String(html || '').replace(/<[^>]*>/g, '').trim();
19
+ };
20
+ var hint = function hint(html) {
21
+ return addNewWindowHint(html, {
22
+ treatMissingTargetAsBlank: true,
23
+ className: TIMELINE_HINT_CLASS
24
+ });
25
+ };
26
+ var prepareMedia = function prepareMedia(media, headline) {
27
+ if (!media || typeof media.url !== 'string') return media;
28
+ var match = DRIVE_FILE.exec(media.url);
29
+ if (!match) return _objectSpread2(_objectSpread2({}, media), {}, {
30
+ caption: hint(media.caption)
31
+ });
32
+ var _match = _slicedToArray(match, 2),
33
+ id = _match[1];
34
+ var _getIntl = getIntl(),
35
+ formatMessage = _getIntl.formatMessage;
36
+ var alt = formatMessage({
37
+ id: 'chronology.videoThumbnail'
38
+ }, {
39
+ title: stripTags(headline)
40
+ });
41
+ var watch = "<a href=\"".concat(driveView(id), "\" target=\"_blank\" rel=\"noopener noreferrer\">").concat(formatMessage({
42
+ id: 'chronology.watchVideo'
43
+ }), "<span class=\"").concat(TIMELINE_HINT_CLASS, "\">").concat(newWindowHintText(), "</span></a>");
44
+ return _objectSpread2(_objectSpread2({}, media), {}, {
45
+ url: driveThumbnail(id),
46
+ thumbnail: driveThumbnail(id),
47
+ alt: alt,
48
+ /* 套件沒有 title 時拿圖說當圖片 title,會變成「觀看影片…」,但圖片本身不是連結 */
49
+ title: alt,
50
+ /* 連結放在圖說,不包在圖片上:同一個目的地只留一個連結,文字也看得到 */
51
+ caption: [watch, hint(media.caption)].filter(Boolean).join('<br />'),
52
+ link: undefined
53
+ });
54
+ };
55
+ var prepareSlide = function prepareSlide(slide) {
56
+ if (!slide) return slide;
57
+ var text = slide.text ? _objectSpread2(_objectSpread2({}, slide.text), {}, {
58
+ headline: hint(slide.text.headline),
59
+ text: hint(slide.text.text)
60
+ }) : slide.text;
61
+ return _objectSpread2(_objectSpread2({}, slide), {}, {
62
+ text: text,
63
+ media: prepareMedia(slide.media, slide.text && slide.text.headline)
64
+ });
65
+ };
66
+
67
+ /**
68
+ * @param {object} data TimelineJS 的資料({ title?, events[] })
69
+ */
70
+ var prepareTimelineData = function prepareTimelineData(data) {
71
+ if (!data || !Array.isArray(data.events)) return data;
72
+ return _objectSpread2(_objectSpread2({}, data), {}, {
73
+ title: data.title ? prepareSlide(data.title) : data.title,
74
+ events: data.events.map(prepareSlide)
75
+ });
76
+ };
77
+
78
+ export { TIMELINE_HINT_CLASS, prepareTimelineData as default };
@@ -0,0 +1,53 @@
1
+ import { n as newWindowHintText } from './newWindowHint-db113a69.js';
2
+ import '../components/globalConfig';
3
+
4
+ /*
5
+ * TimelineJS 建立後的焦點與名稱整理(數位部人工檢測退回 2026-10-07,主站 nmtl-web 同步),回傳解除監聽的函式:
6
+ * 1. 只有目前這張投影片可以被 Tab 走到:其餘投影片加 inert
7
+ * (原本 Tab 會穿過所有畫面外的投影片;讀屏也不會讀到畫面外的內容)
8
+ * 2. 箭頭的 aria-label 是套件用相鄰投影片標題組的,拿掉標題連結上的「(另開新視窗)」(箭頭本身不會另開)
9
+ *
10
+ * 用法:
11
+ * const timeline = new Timeline('timeline-embed', prepareTimelineData(data), options);
12
+ * return syncTimelineA11y(timeline, document.getElementById('timeline-embed'));
13
+ */
14
+ var syncTimelineA11y = function syncTimelineA11y(timeline, root) {
15
+ if (!timeline || !root) return function () {};
16
+ var hint = newWindowHintText();
17
+ var syncInert = function syncInert() {
18
+ /* 剛載入時 Timeline 的 current_id 可能還是空的,退回讀 storyslider 的;
19
+ 兩者都沒有就先不動,避免把畫面上的這張也設成 inert */
20
+ // eslint-disable-next-line no-underscore-dangle
21
+ var currentId = timeline.current_id || timeline._storyslider && timeline._storyslider.current_id;
22
+ if (!currentId) return;
23
+ root.querySelectorAll('.tl-slide').forEach(function (slide) {
24
+ if (slide.id === currentId) slide.removeAttribute('inert');else slide.setAttribute('inert', '');
25
+ });
26
+ };
27
+ var syncNavLabels = function syncNavLabels() {
28
+ if (!hint) return;
29
+ root.querySelectorAll('.tl-slidenav-previous, .tl-slidenav-next').forEach(function (nav) {
30
+ var label = nav.getAttribute('aria-label');
31
+ if (label && label.indexOf(hint) !== -1) nav.setAttribute('aria-label', label.split(hint).join(''));
32
+ });
33
+ };
34
+ var timer;
35
+ var apply = function apply() {
36
+ syncInert();
37
+ syncNavLabels();
38
+ /* 套件在同一輪事件裡才更新箭頭標題,下一輪再整理一次 */
39
+ clearTimeout(timer);
40
+ timer = setTimeout(syncNavLabels, 0);
41
+ };
42
+ /* 投影片是套件非同步建出來的:建好(loaded)與每次換頁(change)都重新套用 */
43
+ timeline.on('loaded', apply);
44
+ timeline.on('change', apply);
45
+ apply();
46
+ return function () {
47
+ clearTimeout(timer);
48
+ timeline.off('loaded', apply);
49
+ timeline.off('change', apply);
50
+ };
51
+ };
52
+
53
+ export { syncTimelineA11y as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@daoyi/nmtl-ui",
3
3
  "packageManager": "pnpm@10.34.5",
4
- "version": "2.0.1-beta.133",
4
+ "version": "2.0.1-beta.135",
5
5
  "description": "This project is to be used as a starter kit for building React component using Storybook and Rollup",
6
6
  "author": "daoyi",
7
7
  "main": "lib/index.js",