@box/metadata-editor 1.67.6 → 1.69.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/dist/chunks/ai-suggestion-field.js +77 -60
- package/dist/chunks/interactive-text.module.js +5 -0
- package/dist/chunks/metadata-instance-content.js +36 -24
- package/dist/chunks/metadata-instance-entry.js +61 -52
- package/dist/chunks/metadata-instance-form-autofill-button.js +5 -5
- package/dist/chunks/metadata-instance-form-card-wrapper.js +6 -6
- package/dist/chunks/metadata-instance-form-footer.js +1 -1
- package/dist/chunks/metadata-instance-form-header.js +8 -8
- package/dist/chunks/metadata-instance-header.js +4 -4
- package/dist/chunks/utils.js +67 -37
- package/dist/esm/index.js +12 -15
- package/dist/esm/lib/components/interactive-text/interactive-text.js +18 -2
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +19 -16
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +20 -17
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/low-confidence-suggestion-field.js +4 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +1 -1
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +13 -12
- package/dist/esm/lib/components/metadata-instance-editor/index.js +9 -7
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +86 -84
- package/dist/esm/lib/components/metadata-instance-list/index.js +6 -4
- package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +1 -0
- package/dist/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +34 -31
- package/dist/esm/lib/utils/analytics/analytics-context.js +11 -0
- package/dist/esm/lib/utils/analytics/events.js +9 -0
- package/dist/esm/lib/utils/analytics/index.js +4 -0
- package/dist/esm/lib/utils/analytics/with-analytics.js +11 -0
- package/dist/esm/lib/utils/confidence-score/index.js +5 -5
- package/dist/i18n/en-x-pseudo.js +156 -156
- package/dist/i18n/en-x-pseudo.properties +156 -156
- package/dist/styles/interactive-text.css +1 -1
- package/dist/styles/utils.css +1 -1
- package/dist/types/lib/components/metadata-instance-editor/index.d.ts +6 -1
- package/dist/types/lib/components/metadata-instance-list/index.d.ts +12 -2
- package/dist/types/lib/components/unsaved-changes-modal/types.d.ts +7 -0
- package/dist/types/lib/components/unsaved-changes-modal/unsaved-changes-modal.d.ts +1 -1
- package/dist/types/lib/test-utils/index.d.ts +1 -0
- package/dist/types/lib/test-utils/mock-resize-observer.d.ts +5 -0
- package/dist/types/lib/utils/analytics/analytics-context.d.ts +12 -0
- package/dist/types/lib/utils/analytics/events.d.ts +9 -0
- package/dist/types/lib/utils/analytics/index.d.ts +3 -0
- package/dist/types/lib/utils/analytics/with-analytics.d.ts +8 -0
- package/package.json +4 -4
- package/dist/chunks/interactive-text.js +0 -17
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const MetadataInstanceList: {
|
|
2
|
+
({ trackEvent, ...rest }: import('./types').MetadataInstanceListProps & {
|
|
3
|
+
trackEvent?: import('../../utils/analytics').TrackEventCallback;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const MetadataInstance: {
|
|
8
|
+
({ trackEvent, ...rest }: import('./subcomponents/metadata-instance/types').MetadataInstanceProps & {
|
|
9
|
+
trackEvent?: import('../../utils/analytics').TrackEventCallback;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
2
13
|
export * from './subcomponents/metadata-instance-header/metadata-instance-header';
|
|
3
|
-
export * from './subcomponents/metadata-instance/metadata-instance';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ModalProps } from '@box/blueprint-web';
|
|
2
|
+
import { TrackEventCallback } from '../../utils/analytics';
|
|
2
3
|
export interface UnsavedChangesModalProps extends Pick<ModalProps, 'open' | 'defaultOpen'> {
|
|
3
4
|
/**
|
|
4
5
|
* Callback to be invoked when the user clicks the "Continue Editing" button or the (X) button.
|
|
@@ -14,4 +15,10 @@ export interface UnsavedChangesModalProps extends Pick<ModalProps, 'open' | 'def
|
|
|
14
15
|
* closing the modal.
|
|
15
16
|
*/
|
|
16
17
|
onDiscardChanges: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Optional analytics callback invoked when the modal is shown and when the user
|
|
20
|
+
* discards changes. The host is responsible for forwarding to its analytics pipeline
|
|
21
|
+
* and attaching any tags (e.g. `component`).
|
|
22
|
+
*/
|
|
23
|
+
trackEvent?: TrackEventCallback;
|
|
17
24
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UnsavedChangesModalProps } from './types';
|
|
2
|
-
export declare function UnsavedChangesModal({ onBackToEdit, onDiscardChanges, defaultOpen, open: propsOpen, }: UnsavedChangesModalProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function UnsavedChangesModal({ onBackToEdit, onDiscardChanges, defaultOpen, open: propsOpen, trackEvent, }: UnsavedChangesModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TrackEventCallback } from './events';
|
|
3
|
+
export type AnalyticsContextValue = {
|
|
4
|
+
trackEvent: TrackEventCallback;
|
|
5
|
+
};
|
|
6
|
+
export declare const AnalyticsContext: React.Context<AnalyticsContextValue>;
|
|
7
|
+
export interface AnalyticsContextProviderProps {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
trackEvent?: TrackEventCallback;
|
|
10
|
+
}
|
|
11
|
+
export declare const AnalyticsContextProvider: ({ children, trackEvent, }: AnalyticsContextProviderProps) => React.ReactElement;
|
|
12
|
+
export declare const useMetadataEditorAnalytics: () => AnalyticsContextValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const EVENT_NAMES: {
|
|
2
|
+
readonly LOW_CONF_BADGE_HOVER: "metadata_editor_low_conf_badge_hover";
|
|
3
|
+
readonly LOW_CONF_ICON_HOVER_READ_MODE: "metadata_editor_low_conf_icon_hover_read_mode";
|
|
4
|
+
readonly AI_SUGGESTION_SHOWN: "metadata_editor_ai_suggestion_shown";
|
|
5
|
+
readonly UNSAVED_MODAL_SHOWN: "metadata_editor_unsaved_modal_shown";
|
|
6
|
+
readonly UNSAVED_MODAL_DISCARD: "metadata_editor_unsaved_modal_discard";
|
|
7
|
+
readonly AI_LOGO_BADGE_HOVER: "metadata_editor_conf_score_icon_hover";
|
|
8
|
+
};
|
|
9
|
+
export type TrackEventCallback = (eventName: string, data?: Record<string, unknown>) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TrackEventCallback } from './events';
|
|
3
|
+
export declare function withAnalytics<P extends object>(Component: React.ComponentType<P>): {
|
|
4
|
+
({ trackEvent, ...rest }: P & {
|
|
5
|
+
trackEvent?: TrackEventCallback;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-editor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.69.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@ariakit/react": "0.4.21",
|
|
6
6
|
"@box/blueprint-web": "^14.18.0",
|
|
7
7
|
"@box/blueprint-web-assets": "^4.115.4",
|
|
8
|
-
"@box/box-ai-agent-selector": "^1.40.
|
|
9
|
-
"@box/combobox-with-api": "^1.43.
|
|
8
|
+
"@box/box-ai-agent-selector": "^1.40.7",
|
|
9
|
+
"@box/combobox-with-api": "^1.43.7",
|
|
10
10
|
"formik": "^2.0.3",
|
|
11
11
|
"lodash": "^4.17.15",
|
|
12
12
|
"react": "^17.0.0 || ^18.0.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@box/babel-plugin-target-attributes": "1.5.19",
|
|
19
19
|
"@box/blueprint-web": "^14.18.0",
|
|
20
20
|
"@box/blueprint-web-assets": "^4.115.4",
|
|
21
|
-
"@box/box-ai-agent-selector": "^1.40.
|
|
21
|
+
"@box/box-ai-agent-selector": "^1.40.7",
|
|
22
22
|
"@box/storybook-utils": "^0.18.4",
|
|
23
23
|
"@testing-library/react": "^15.0.6",
|
|
24
24
|
"react": "^18.3.0",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Text as e, Tooltip as t } from "@box/blueprint-web";
|
|
2
|
-
import { Focusable as n } from "@ariakit/react";
|
|
3
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
-
import i from "clsx";
|
|
5
|
-
import '../styles/interactive-text.css';var a = { interactiveText: "_interactiveText_1i8lr_1" }, o = ({ tooltipText: o, className: s, children: c, ...l }) => {
|
|
6
|
-
let { as: u = "span" } = l;
|
|
7
|
-
return /* @__PURE__ */ r(t, {
|
|
8
|
-
content: o,
|
|
9
|
-
children: /* @__PURE__ */ r(n, { render: /* @__PURE__ */ r(e, {
|
|
10
|
-
as: u,
|
|
11
|
-
className: i(a.interactiveText, s),
|
|
12
|
-
...l,
|
|
13
|
-
children: c
|
|
14
|
-
}) })
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
export { o as t };
|