@plasmicpkgs/plasmic-rich-components 1.0.144 → 1.0.145

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.
@@ -1,9 +1,9 @@
1
1
  import registerComponent from '@plasmicapp/host/registerComponent';
2
2
  import '@plasmicapp/host/registerGlobalContext';
3
- import React, { useState, useEffect, useRef, useMemo } from 'react';
3
+ import { parseDate } from '@plasmicpkgs/luxon-parser';
4
4
  import dayjs from 'dayjs';
5
5
  import customParseFormat from 'dayjs/plugin/customParseFormat';
6
- import { DateTime } from 'luxon';
6
+ import React, { useState, useEffect, useRef, useMemo } from 'react';
7
7
  import { Result, Checkbox, Switch, Empty, Descriptions, theme, ConfigProvider, Dropdown, Button, Input, List, Tag, Card, Calendar, Badge } from 'antd';
8
8
  import 'lodash/get';
9
9
  import { normalizeData, deriveFieldConfigs } from '@plasmicapp/data-sources';
@@ -58,25 +58,6 @@ function isValidIsoDate(str, extendedOnly = false) {
58
58
  return false;
59
59
  return true;
60
60
  }
61
- function parseDate(value) {
62
- const dateTimeParsers = [
63
- DateTime.fromISO,
64
- DateTime.fromRFC2822,
65
- DateTime.fromHTTP,
66
- DateTime.fromSQL
67
- ];
68
- if (!value)
69
- return void 0;
70
- if (typeof value !== "string")
71
- return void 0;
72
- for (const parser of dateTimeParsers) {
73
- const parsed = parser(value);
74
- if (parsed.isValid) {
75
- return parsed;
76
- }
77
- }
78
- return void 0;
79
- }
80
61
  function isLikeDate(value) {
81
62
  const parsed = parseDate(value);
82
63
  return parsed ? true : false;
@@ -735,9 +716,7 @@ function coerceValue(value, dataType) {
735
716
  return new Date(value);
736
717
  } else if (typeof value === "string") {
737
718
  const parsed = parseDate(value);
738
- if (parsed) {
739
- return parsed.toJSDate();
740
- }
719
+ return parsed ? parsed : CANNOT_COERCE;
741
720
  }
742
721
  } else if (dataType === "boolean") {
743
722
  if (value === true || value === false) {
@@ -2747,7 +2726,7 @@ dayjs.extend(weekday);
2747
2726
  dayjs.extend(localeData);
2748
2727
  function getEventFullDate(date) {
2749
2728
  var _a;
2750
- return ((_a = parseDate(date)) == null ? void 0 : _a.toISODate()) || void 0;
2729
+ return ((_a = parseDate(date)) == null ? void 0 : _a.toISOString()) || void 0;
2751
2730
  }
2752
2731
  function getEventMonthYear(date) {
2753
2732
  var _a;