@box/metadata-editor 0.131.12 → 0.132.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.
@@ -1,15 +1,18 @@
1
- import { DateFormatter as i } from "@box/blueprint-web";
2
- function f(r, {
1
+ import { getLocalTimeZone as a, DateFormatter as f } from "@box/blueprint-web";
2
+ import { convertIsoStringToCalendarDate as m } from "../../../../utils/convertDate.js";
3
+ function c(t, {
3
4
  type: n = "string",
4
5
  locale: e = "en"
5
6
  } = {}) {
6
- if (n === "date" && typeof r == "string") {
7
- const t = new Date(r);
8
- if (!isNaN(t.getTime()))
9
- return new i(e).format(t);
7
+ if (n === "date" && typeof t == "string") {
8
+ const o = !isNaN(new Date(t).getTime()), r = m(t);
9
+ if (r && o) {
10
+ const i = r.toDate(a());
11
+ return new f(e).format(i);
12
+ }
10
13
  }
11
- return r == null ? null : typeof r == "number" ? r.toString() : Array.isArray(r) ? r.join(", ") : r;
14
+ return t == null ? null : typeof t == "number" ? t.toString() : Array.isArray(t) ? t.join(", ") : t;
12
15
  }
13
16
  export {
14
- f as formatSuggestionValue
17
+ c as formatSuggestionValue
15
18
  };
@@ -1,4 +1,4 @@
1
- import { BoxAiColor as t, BoxAiAdvancedColor as A } from "@box/blueprint-web-assets/icons/Medium";
1
+ import { BoxAiLogo24 as t, BoxAiAdvancedLogo24 as A } from "@box/blueprint-web-assets/icons/Logo";
2
2
  const e = "properties", E = "extractAgent", a = {
3
3
  standard: {
4
4
  AGENT_TYPE: "standard",
@@ -1,4 +1,5 @@
1
1
  import { MetadataTemplateField } from '../types';
2
+ export { createTimezoneTestUtils, timezoneTestUtils, useTimezoneTestSetup, type TimezoneTestUtilsOptions, } from './timezone-test-utils';
2
3
  export declare const updateText: (el: any, text: any) => Promise<void>;
3
4
  export declare const blur: () => Promise<void>;
4
5
  export declare const updateTextAndBlur: (el: any, text: any) => Promise<void>;
@@ -0,0 +1,21 @@
1
+ export interface TimezoneTestUtilsOptions {
2
+ testDate?: string;
3
+ }
4
+ export declare function createTimezoneTestUtils(options?: TimezoneTestUtilsOptions): {
5
+ setupTimezoneTests: () => void;
6
+ setTimezone: (timezone: string) => void;
7
+ restoreTimezone: () => void;
8
+ getOriginalTimezone: () => string;
9
+ };
10
+ export declare const timezoneTestUtils: {
11
+ setupTimezoneTests: () => void;
12
+ setTimezone: (timezone: string) => void;
13
+ restoreTimezone: () => void;
14
+ getOriginalTimezone: () => string;
15
+ };
16
+ export declare function useTimezoneTestSetup(options?: TimezoneTestUtilsOptions): {
17
+ setupTimezoneTests: () => void;
18
+ setTimezone: (timezone: string) => void;
19
+ restoreTimezone: () => void;
20
+ getOriginalTimezone: () => string;
21
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "0.131.12",
3
+ "version": "0.132.0",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.15",
6
6
  "@box/box-ai-agent-selector": "^0.55.2",
@@ -15,11 +15,11 @@
15
15
  },
16
16
  "devDependencies": {
17
17
  "@ariakit/react": "0.4.15",
18
- "@box/box-ai-agent-selector": "^0.59.12",
18
+ "@box/box-ai-agent-selector": "^0.60.0",
19
19
  "@box/babel-plugin-target-attributes": "1.3.0",
20
- "@box/blueprint-web": "^12.75.6",
21
- "@box/blueprint-web-assets": "^4.67.0",
22
- "@box/storybook-utils": "^0.14.3",
20
+ "@box/blueprint-web": "^12.76.0",
21
+ "@box/blueprint-web-assets": "^4.68.0",
22
+ "@box/storybook-utils": "^0.14.4",
23
23
  "@testing-library/react": "^15.0.6",
24
24
  "react": "^18.3.0",
25
25
  "react-dom": "^18.3.0",