attio 0.0.1-experimental.20241031 → 0.0.1-experimental.20241203.2
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/lib/api/handle-error.js +1 -1
- package/lib/attio.js +1 -1
- package/lib/build/client/generate-client-entry.js +34 -22
- package/lib/client/alert.d.ts +59 -0
- package/lib/client/bulk-record-action.d.ts +54 -0
- package/lib/client/components/index.d.ts +0 -2
- package/lib/client/confirm.d.ts +80 -0
- package/lib/client/hooks/index.d.ts +1 -1
- package/lib/client/hooks/use-workspace.d.ts +13 -0
- package/lib/client/index.d.ts +5 -2
- package/lib/client/record-action.d.ts +53 -0
- package/lib/client/show-dialog.d.ts +33 -0
- package/lib/client/show-toast.d.ts +1 -1
- package/lib/commands/dev.js +2 -0
- package/lib/components/CodeGenErrors.js +2 -2
- package/lib/components/Log.js +69 -0
- package/lib/machines/dev-machine.js +6 -3
- package/lib/machines/js-machine.js +0 -4
- package/lib/templates/common/src/assets/icon.png +0 -0
- package/lib/templates/javascript/package.json +6 -4
- package/lib/templates/javascript/src/advice.jsx +16 -0
- package/lib/templates/javascript/src/get-advice.server.js +6 -0
- package/lib/templates/javascript/src/hello-world-action.jsx +17 -0
- package/lib/templates/javascript/src/hello-world-dialog.jsx +25 -0
- package/lib/templates/typescript/package.json +8 -6
- package/lib/templates/typescript/src/advice.tsx +16 -0
- package/lib/templates/typescript/src/get-advice.server.ts +6 -0
- package/lib/templates/typescript/src/hello-world-action.tsx +17 -0
- package/lib/templates/typescript/src/hello-world-dialog.tsx +25 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/util/copy-with-replace.js +10 -5
- package/lib/util/create-directory.js +1 -1
- package/lib/util/find-node-modules-path.js +1 -1
- package/lib/util/find-surface-exports.js +76 -0
- package/lib/util/load-env.js +1 -1
- package/lib/util/surfaces.js +4 -0
- package/package.json +4 -4
- package/schema.graphql +14 -0
- package/lib/client/components/action.d.ts +0 -31
- package/lib/client/components/multistep.d.ts +0 -24
- package/lib/client/hooks/use-dialog.d.ts +0 -71
- package/lib/client/register-bulk-record-action.d.ts +0 -36
- package/lib/client/register-record-action.d.ts +0 -36
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Dialog component
|
|
4
|
-
*
|
|
5
|
-
* IMPORTANT: The <Dialog/> component should _always_ be rendered in your app.
|
|
6
|
-
* Do not render it conditionally.
|
|
7
|
-
*/
|
|
8
|
-
interface Dialog extends React.FC<{
|
|
9
|
-
/**
|
|
10
|
-
* A required title for the dialog.
|
|
11
|
-
*/
|
|
12
|
-
title: string;
|
|
13
|
-
/**
|
|
14
|
-
* An optional callback that will be called when the dialog is closed.
|
|
15
|
-
*/
|
|
16
|
-
onClose?: () => void;
|
|
17
|
-
/**
|
|
18
|
-
* The content of the dialog.
|
|
19
|
-
*/
|
|
20
|
-
children: React.ReactNode;
|
|
21
|
-
}> {
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* This hook allows you to create a modal dialog.
|
|
25
|
-
*
|
|
26
|
-
* ## EXAMPLE USAGE
|
|
27
|
-
*
|
|
28
|
-
* ----
|
|
29
|
-
* ```tsx
|
|
30
|
-
* import { useDialog } from "attio/client"
|
|
31
|
-
*
|
|
32
|
-
* ...
|
|
33
|
-
*
|
|
34
|
-
* // inside component:
|
|
35
|
-
* const dialog = useDialog()
|
|
36
|
-
*
|
|
37
|
-
* return (
|
|
38
|
-
* <>
|
|
39
|
-
* <Action onTrigger={() => dialog.open()}>Do Stuff</Action>
|
|
40
|
-
* <dialog.Dialog>
|
|
41
|
-
* Here is my useful UI
|
|
42
|
-
* </dialog.Dialog>
|
|
43
|
-
* </>
|
|
44
|
-
* )
|
|
45
|
-
* ```
|
|
46
|
-
* ----
|
|
47
|
-
*
|
|
48
|
-
* @returns An object with the following properties:
|
|
49
|
-
* - `Dialog`: A React component that you should render with the dialog contents as its children.
|
|
50
|
-
* - `open`: Opens the rendered dialog.
|
|
51
|
-
* - `close`: Closes the rendered dialog.
|
|
52
|
-
*/
|
|
53
|
-
export declare function useDialog(): {
|
|
54
|
-
/**
|
|
55
|
-
* The dialog component to render.
|
|
56
|
-
*
|
|
57
|
-
* IMPORTANT: The <Dialog/> component should _always_ be rendered in your app.
|
|
58
|
-
* Do not render it conditionally.
|
|
59
|
-
*/
|
|
60
|
-
Dialog: Dialog;
|
|
61
|
-
/**
|
|
62
|
-
* A function to imperatively open the dialog. Often called via an
|
|
63
|
-
* `onTrigger` prop on an `<Action/>` button.
|
|
64
|
-
*/
|
|
65
|
-
open: () => void;
|
|
66
|
-
/**
|
|
67
|
-
* A function to imperatively close the dialog.
|
|
68
|
-
*/
|
|
69
|
-
close: () => void;
|
|
70
|
-
};
|
|
71
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ObjectSlug } from "./object-slug";
|
|
2
|
-
/**
|
|
3
|
-
* Registers a component that renders an <Action/> button for a set of records in Attio.
|
|
4
|
-
*
|
|
5
|
-
* You should use this in your `app.tsx` file to register where you want your
|
|
6
|
-
* app to surface inside the Attio UI.
|
|
7
|
-
*
|
|
8
|
-
* ## EXAMPLE USAGE
|
|
9
|
-
*
|
|
10
|
-
* ----
|
|
11
|
-
* ```tsx
|
|
12
|
-
* // app.tsx
|
|
13
|
-
* import { registerBulkRecordAction } from "attio/client";
|
|
14
|
-
* import { SendBulkInvoiceButton } from "./send-invoice-button";
|
|
15
|
-
* import React from "react";
|
|
16
|
-
*
|
|
17
|
-
* registerBulkRecordAction("send-bulk-invoice", <SendBulkInvoiceButton />);
|
|
18
|
-
* ```
|
|
19
|
-
* ----
|
|
20
|
-
*/
|
|
21
|
-
export declare function registerBulkRecordAction(
|
|
22
|
-
/**
|
|
23
|
-
* The unique identifier for the action.
|
|
24
|
-
*
|
|
25
|
-
* It is only used internally; never shown to the user.
|
|
26
|
-
*/
|
|
27
|
-
id: string,
|
|
28
|
-
/**
|
|
29
|
-
* The React element to render for the action.
|
|
30
|
-
*/
|
|
31
|
-
action: React.ReactElement, options?: {
|
|
32
|
-
/**
|
|
33
|
-
* If provided then the action will only be shown on records of the specified object(s).
|
|
34
|
-
*/
|
|
35
|
-
objects: ObjectSlug | Array<ObjectSlug>;
|
|
36
|
-
}): void;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ObjectSlug } from "./object-slug";
|
|
2
|
-
/**
|
|
3
|
-
* Registers a component that renders an <Action/> button for a record in Attio.
|
|
4
|
-
*
|
|
5
|
-
* You should use this in your `app.tsx` file to register where you want your
|
|
6
|
-
* app to surface inside the Attio UI.
|
|
7
|
-
*
|
|
8
|
-
* ## EXAMPLE USAGE
|
|
9
|
-
*
|
|
10
|
-
* ----
|
|
11
|
-
* ```tsx
|
|
12
|
-
* // app.tsx
|
|
13
|
-
* import { registerRecordAction } from "attio/client";
|
|
14
|
-
* import { SendInvoiceButton } from "./send-invoice-button";
|
|
15
|
-
* import React from "react";
|
|
16
|
-
*
|
|
17
|
-
* registerRecordAction("send-invoice", <SendInvoiceButton />);
|
|
18
|
-
* ```
|
|
19
|
-
* ----
|
|
20
|
-
*/
|
|
21
|
-
export declare function registerRecordAction(
|
|
22
|
-
/**
|
|
23
|
-
* The unique identifier for the action.
|
|
24
|
-
*
|
|
25
|
-
* It is only used internally; never shown to the user.
|
|
26
|
-
*/
|
|
27
|
-
id: string,
|
|
28
|
-
/**
|
|
29
|
-
* The React element to render for the action.
|
|
30
|
-
*/
|
|
31
|
-
action: React.ReactElement, options?: {
|
|
32
|
-
/**
|
|
33
|
-
* If provided then the action will only be shown on records of the specified object(s).
|
|
34
|
-
*/
|
|
35
|
-
objects: ObjectSlug | Array<ObjectSlug>;
|
|
36
|
-
}): void;
|