acsi-core 1.2.16 → 1.2.17

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.
@@ -15,7 +15,6 @@ import rehypeKatex from 'rehype-katex';
15
15
  import remarkRehype from 'remark-rehype';
16
16
  import rehypeRaw from 'rehype-raw';
17
17
  import 'katex/dist/katex.min.css';
18
- import renderMathInElement from 'katex/contrib/auto-render';
19
18
  import Cookies from 'js-cookie';
20
19
  export { default as Cookies } from 'js-cookie';
21
20
  import moment from 'moment';
@@ -1597,39 +1596,6 @@ function formatContent(content) {
1597
1596
  return result.join("\n");
1598
1597
  }
1599
1598
 
1600
- var RichContentRenderer = function RichContentRenderer(_ref) {
1601
- var content = _ref.content;
1602
- var ref = useRef(null);
1603
- var isHtml = /<\/?[a-z][\s\S]*>/i.test(content);
1604
- useEffect(function () {
1605
- if (isHtml && ref.current) {
1606
- renderMathInElement(ref.current, {
1607
- delimiters: [{
1608
- left: "$$",
1609
- right: "$$",
1610
- display: false
1611
- }, {
1612
- left: "$",
1613
- right: "$",
1614
- display: false
1615
- }]
1616
- });
1617
- }
1618
- }, [content, isHtml]);
1619
- if (isHtml) {
1620
- return React.createElement("div", {
1621
- ref: ref,
1622
- dangerouslySetInnerHTML: {
1623
- __html: content
1624
- }
1625
- });
1626
- }
1627
- return React.createElement(ReactMarkdown, {
1628
- remarkPlugins: [remarkMath, remarkGfm],
1629
- rehypePlugins: [rehypeKatex, rehypeRaw]
1630
- }, content);
1631
- };
1632
-
1633
1599
  var CookieService = /*#__PURE__*/function () {
1634
1600
  function CookieService() {}
1635
1601
  CookieService.setAuthCookie = function setAuthCookie(data) {
@@ -3500,25 +3466,43 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
3500
3466
  }, rest));
3501
3467
  };
3502
3468
 
3469
+ var isDateOnlyFormat = function isDateOnlyFormat(fmt) {
3470
+ return !/[Hhms]/.test(fmt);
3471
+ };
3472
+ var parseOffsetToMinutes = function parseOffsetToMinutes(cleanOffset) {
3473
+ if (/^[+-]?\d+$/.test(cleanOffset)) {
3474
+ return parseInt(cleanOffset, 10) * 60;
3475
+ }
3476
+ return moment().utcOffset(cleanOffset).utcOffset();
3477
+ };
3503
3478
  var utcToLocalTime = (function (time, FORMAT) {
3504
3479
  if (time === DATE_MIN_VALUE || time == null) return "";
3505
3480
  var timezone = localStorage.getItem(TIMEZONE_ID) || "";
3481
+ var fmt = FORMAT || "yyyy-MM-DD";
3506
3482
  try {
3507
3483
  if (!timezone) {
3508
- return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
3484
+ if (isDateOnlyFormat(fmt)) {
3485
+ var localOffset = moment().utcOffset();
3486
+ if (localOffset <= 0) return moment.utc(time).format(fmt);
3487
+ }
3488
+ return moment.utc(time).local().format(fmt);
3509
3489
  }
3510
3490
  var isOffset = /^(UTC|GMT)?[+-]/.test(timezone);
3511
3491
  if (isOffset) {
3512
3492
  var cleanOffset = timezone.replace(/UTC|GMT/gi, "").trim();
3513
- var offsetMinutes;
3514
- if (/^[+-]?\d+$/.test(cleanOffset)) {
3515
- offsetMinutes = parseInt(cleanOffset, 10) * 60;
3516
- } else {
3517
- offsetMinutes = cleanOffset;
3493
+ var offsetMinutes = parseOffsetToMinutes(cleanOffset);
3494
+ if (isDateOnlyFormat(fmt) && offsetMinutes <= 0) {
3495
+ return moment.utc(time).format(fmt);
3496
+ }
3497
+ return moment.utc(time).utcOffset(offsetMinutes).format(fmt);
3498
+ }
3499
+ if (isDateOnlyFormat(fmt)) {
3500
+ var tzOffset = moment.utc(time).tz(timezone).utcOffset();
3501
+ if (tzOffset <= 0) {
3502
+ return moment.utc(time).format(fmt);
3518
3503
  }
3519
- return moment.utc(time).utcOffset(offsetMinutes).format(FORMAT || "yyyy-MM-DD");
3520
3504
  }
3521
- return moment.utc(time).tz(timezone).format(FORMAT || "yyyy-MM-DD");
3505
+ return moment.utc(time).tz(timezone).format(fmt);
3522
3506
  } catch (_unused) {
3523
3507
  return "";
3524
3508
  }
@@ -3591,5 +3575,5 @@ var timeSpanToUtc = (function (time, timezone, format) {
3591
3575
 
3592
3576
  var historyCore = createBrowserHistory();
3593
3577
 
3594
- export { ACCESS_TOKEN, AmplitudeEvent, BASE_URL, CommonDialog, ConfirmDialog, CoreButton, CoreInput$1 as CoreCheckbox, CoreError, CoreInput, CoreInputCompact, CoreModal, CoreRadio, CoreRange, CoreSearch, CoreSelect, CoreSelectCompact, CoreTextArea, CoreTitleInput, CoreTooltip, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_TIME_MIN_VALUE, LayoutContext, Loading, Login, MarkdownRenderer as MarkdownLatexRender, NotFound, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT, RichContentRenderer, Role, TIMEZONE_ID, api, apiUpload, firstCheckToken, getAccessToken, getErrorMessage, getImageUrl, getTimeZoneId, historyCore, initSentry, initializeAmplitude, setAddTenant, setAlert, setIsFirstCalendar, setIsRefetchSidebar, setLoading, setLoadingPage, setMenuCollapse, setTeam, setTenant, setUser, store, timeSpanToLocalMoment, timeSpanToUtc, useAmplitude, useGoogleSignOut, utcToLocalTime };
3578
+ export { ACCESS_TOKEN, AmplitudeEvent, BASE_URL, CommonDialog, ConfirmDialog, CoreButton, CoreInput$1 as CoreCheckbox, CoreError, CoreInput, CoreInputCompact, CoreModal, CoreRadio, CoreRange, CoreSearch, CoreSelect, CoreSelectCompact, CoreTextArea, CoreTitleInput, CoreTooltip, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_TIME_MIN_VALUE, LayoutContext, Loading, Login, MarkdownRenderer as MarkdownLatexRender, NotFound, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT, Role, TIMEZONE_ID, api, apiUpload, firstCheckToken, getAccessToken, getErrorMessage, getImageUrl, getTimeZoneId, historyCore, initSentry, initializeAmplitude, setAddTenant, setAlert, setIsFirstCalendar, setIsRefetchSidebar, setLoading, setLoadingPage, setMenuCollapse, setTeam, setTenant, setUser, store, timeSpanToLocalMoment, timeSpanToUtc, useAmplitude, useGoogleSignOut, utcToLocalTime };
3595
3579
  //# sourceMappingURL=index.modern.js.map