@sanity/cross-dataset-duplicator 1.5.1 → 2.0.1

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/index.d.ts CHANGED
@@ -1,81 +1,62 @@
1
- import {DocumentActionProps} from 'sanity'
2
- import {ForwardRefExoticComponent} from 'react'
3
- import {Plugin as Plugin_2} from 'sanity'
4
- import {RefAttributes} from 'react'
5
- import {SanityDocument} from 'sanity'
6
- import {SVGProps} from 'react'
7
-
1
+ import { DocumentActionProps, SanityDocument } from "sanity";
2
+ type PreDefinedQuery = {
3
+ label: string;
4
+ query: string;
5
+ };
8
6
  /**
9
- * Plugin: Cross Dataset Duplicator
7
+ * Plugin configuration
10
8
  * @public
11
9
  */
12
- export declare const crossDatasetDuplicator: Plugin_2<void | Partial<PluginConfig>>
13
-
10
+ interface PluginConfig {
11
+ apiVersion?: string;
12
+ tool?: boolean;
13
+ types?: string[];
14
+ filter?: string;
15
+ follow?: ('inbound' | 'outbound')[];
16
+ queries?: PreDefinedQuery[];
17
+ }
14
18
  /**
15
- * Component to perform a migration from the Cross Dataset Duplicator plugin
19
+ * Cross Dataset Duplicator document action props
16
20
  * @public
17
21
  */
18
- export declare function CrossDatasetDuplicatorAction(
19
- props: CrossDatasetDuplicatorActionProps,
20
- ): JSX.Element
21
-
22
+ type CrossDatasetDuplicatorActionProps = {
23
+ docs: SanityDocument[];
24
+ onDuplicated?: () => Promise<void>;
25
+ };
22
26
  /**
23
- * Cross Dataset Duplicator document action props
27
+ * Plugin: Cross Dataset Duplicator
24
28
  * @public
25
29
  */
26
- export declare type CrossDatasetDuplicatorActionProps = {
27
- docs: SanityDocument[]
28
- onDuplicated?: () => Promise<void>
29
- }
30
-
30
+ declare const crossDatasetDuplicator: import("sanity").Plugin<void | Partial<PluginConfig>>;
31
31
  /**
32
32
  * Document action from the Cross Dataset Duplicator plugin
33
33
  * @public
34
34
  */
35
- export declare const DuplicateToAction: {
35
+ declare const DuplicateToAction: {
36
36
  (props: DocumentActionProps): {
37
- disabled: SanityDocument | null
38
- title: string | null
39
- label: string
40
- dialog:
41
- | false
42
- | {
43
- type: string
44
- title: string
45
- content: JSX.Element
46
- onClose: () => void
47
- }
48
- | null
49
- onHandle: () => void
50
- icon: ForwardRefExoticComponent<
51
- Omit<SVGProps<SVGSVGElement>, 'ref'> & RefAttributes<SVGSVGElement>
52
- >
53
- }
54
- action: string
55
- }
56
-
37
+ disabled: boolean;
38
+ title: string | null;
39
+ label: string;
40
+ dialog: false | {
41
+ type: string;
42
+ title: string;
43
+ content: import("react").JSX.Element;
44
+ onClose: () => void;
45
+ } | null;
46
+ onHandle: () => void;
47
+ icon: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
48
+ };
49
+ action: string;
50
+ };
57
51
  /**
58
- * Plugin configuration
52
+ * Plugin config context hook from the Cross Dataset Duplicator plugin
59
53
  * @public
60
54
  */
61
- export declare interface PluginConfig {
62
- apiVersion?: string
63
- tool?: boolean
64
- types?: string[]
65
- filter?: string
66
- follow?: ('inbound' | 'outbound')[]
67
- queries?: PreDefinedQuery[]
68
- }
69
-
70
- declare type PreDefinedQuery = {
71
- label: string
72
- query: string
73
- }
74
-
55
+ declare function useCrossDatasetDuplicatorConfig(): Required<PluginConfig>;
75
56
  /**
76
- * Plugin config context hook from the Cross Dataset Duplicator plugin
57
+ * Component to perform a migration from the Cross Dataset Duplicator plugin
77
58
  * @public
78
59
  */
79
- export declare function useCrossDatasetDuplicatorConfig(): Required<PluginConfig>
80
-
81
- export {}
60
+ declare function CrossDatasetDuplicatorAction(props: CrossDatasetDuplicatorActionProps): import("react").JSX.Element;
61
+ export { CrossDatasetDuplicatorAction, CrossDatasetDuplicatorActionProps, DuplicateToAction, PluginConfig, crossDatasetDuplicator, useCrossDatasetDuplicatorConfig };
62
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types/index.ts","../src/plugin.tsx","../src/actions/DuplicateToAction.tsx","../src/context/ConfigProvider.tsx","../src/components/CrossDatasetDuplicatorAction.tsx"],"mappings":";KAEK,eAAA;EACH,KAAA;EACA,KAAK;AAAA;;AAAA;AAMP;;UAAiB,YAAA;EACf,UAAA;EACA,IAAA;EACA,KAAA;EACA,MAAA;EACA,MAAA;EACA,OAAA,GAAU,eAAe;AAAA;;;AAAA;AAO3B;KAAY,iCAAA;EACV,IAAA,EAAM,cAAA;EACN,YAAA,SAAqB,OAAO;AAAA;;AAzBY;;;cCY7B,sBAAA,mBAAsB,MAAA,QAAA,OAAA,CAAA,YAAA;;ADZO;;;cEU7B,iBAAA;EAAA,QAA4B,mBAAA;;;;;;;;;;;;;;;;AFNlC;AAMP;;iBGIgB,+BAAA,IAA+B,QAAA,CAAA,YAAA;;AHdL;;;iBIO1B,4BAAA,CAA6B,KAAA,EAAO,iCAAiC,mBAAA,GAAA,CAAA,OAAA"}