@hubspot/ui-extensions 0.10.0 → 0.11.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.
Files changed (133) hide show
  1. package/dist/{pages/home/components.d.ts → __synced__/appHomeRemoteComponents.synced.d.ts} +7 -7
  2. package/dist/{pages/home/components.js → __synced__/appHomeRemoteComponents.synced.js} +1 -0
  3. package/dist/{crm/components.d.ts → __synced__/crmRemoteComponents.synced.d.ts} +40 -41
  4. package/dist/__synced__/crmRemoteComponents.synced.js +15 -0
  5. package/dist/__synced__/experimental/types.synced.d.ts +241 -0
  6. package/dist/__synced__/experimental/types.synced.js +5 -0
  7. package/dist/__synced__/experimentalRemoteComponents.synced.d.ts +94 -0
  8. package/dist/__synced__/experimentalRemoteComponents.synced.js +56 -0
  9. package/dist/__synced__/remoteComponents.synced.d.ts +848 -0
  10. package/dist/__synced__/remoteComponents.synced.js +583 -0
  11. package/dist/__synced__/types/actions.synced.d.ts +57 -0
  12. package/dist/__synced__/types/actions.synced.js +1 -0
  13. package/dist/__synced__/types/components/accordion.synced.d.ts +48 -0
  14. package/dist/__synced__/types/components/accordion.synced.js +1 -0
  15. package/dist/__synced__/types/components/alert.synced.d.ts +24 -0
  16. package/dist/__synced__/types/components/alert.synced.js +1 -0
  17. package/dist/__synced__/types/components/app-home-header-actions.synced.d.ts +39 -0
  18. package/dist/__synced__/types/components/app-home-header-actions.synced.js +1 -0
  19. package/dist/__synced__/types/components/button-row.synced.d.ts +44 -0
  20. package/dist/__synced__/types/components/button-row.synced.js +1 -0
  21. package/dist/__synced__/types/components/button.synced.d.ts +89 -0
  22. package/dist/__synced__/types/components/button.synced.js +1 -0
  23. package/dist/__synced__/types/components/card.synced.d.ts +12 -0
  24. package/dist/__synced__/types/components/card.synced.js +1 -0
  25. package/dist/__synced__/types/components/chart.synced.d.ts +137 -0
  26. package/dist/__synced__/types/components/chart.synced.js +5 -0
  27. package/dist/__synced__/types/components/description-list.synced.d.ts +36 -0
  28. package/dist/__synced__/types/components/description-list.synced.js +1 -0
  29. package/dist/__synced__/types/components/divider.synced.d.ts +14 -0
  30. package/dist/__synced__/types/components/divider.synced.js +1 -0
  31. package/dist/__synced__/types/components/dropdown.synced.d.ts +84 -0
  32. package/dist/__synced__/types/components/dropdown.synced.js +1 -0
  33. package/dist/__synced__/types/components/empty-state.synced.d.ts +51 -0
  34. package/dist/__synced__/types/components/empty-state.synced.js +1 -0
  35. package/dist/__synced__/types/components/error-state.synced.d.ts +24 -0
  36. package/dist/__synced__/types/components/error-state.synced.js +1 -0
  37. package/dist/__synced__/types/components/form.synced.d.ts +29 -0
  38. package/dist/__synced__/types/components/form.synced.js +1 -0
  39. package/dist/__synced__/types/components/heading.synced.d.ts +19 -0
  40. package/dist/__synced__/types/components/heading.synced.js +1 -0
  41. package/dist/__synced__/types/components/icon.synced.d.ts +29 -0
  42. package/dist/__synced__/types/components/icon.synced.js +1 -0
  43. package/dist/__synced__/types/components/iframe.synced.d.ts +20 -0
  44. package/dist/__synced__/types/components/iframe.synced.js +1 -0
  45. package/dist/__synced__/types/components/illustration.synced.d.ts +53 -0
  46. package/dist/__synced__/types/components/illustration.synced.js +43 -0
  47. package/dist/__synced__/types/components/image.synced.d.ts +40 -0
  48. package/dist/__synced__/types/components/image.synced.js +1 -0
  49. package/dist/__synced__/types/components/index.synced.d.ts +38 -0
  50. package/dist/__synced__/types/components/index.synced.js +1 -0
  51. package/dist/__synced__/types/components/inputs.synced.d.ts +350 -0
  52. package/dist/__synced__/types/components/inputs.synced.js +1 -0
  53. package/dist/__synced__/types/components/layouts.synced.d.ts +172 -0
  54. package/dist/__synced__/types/components/layouts.synced.js +1 -0
  55. package/dist/__synced__/types/components/link.synced.d.ts +38 -0
  56. package/dist/__synced__/types/components/link.synced.js +1 -0
  57. package/dist/__synced__/types/components/list.synced.d.ts +18 -0
  58. package/dist/__synced__/types/components/list.synced.js +1 -0
  59. package/dist/__synced__/types/components/loading-spinner.synced.d.ts +31 -0
  60. package/dist/__synced__/types/components/loading-spinner.synced.js +1 -0
  61. package/dist/__synced__/types/components/modal.synced.d.ts +60 -0
  62. package/dist/__synced__/types/components/modal.synced.js +1 -0
  63. package/dist/__synced__/types/components/panel.synced.d.ts +73 -0
  64. package/dist/__synced__/types/components/panel.synced.js +1 -0
  65. package/dist/__synced__/types/components/progress-bar.synced.d.ts +48 -0
  66. package/dist/__synced__/types/components/progress-bar.synced.js +1 -0
  67. package/dist/__synced__/types/components/selects.synced.d.ts +130 -0
  68. package/dist/__synced__/types/components/selects.synced.js +1 -0
  69. package/dist/__synced__/types/components/statistics.synced.d.ts +56 -0
  70. package/dist/__synced__/types/components/statistics.synced.js +1 -0
  71. package/dist/__synced__/types/components/status-tag.synced.d.ts +42 -0
  72. package/dist/__synced__/types/components/status-tag.synced.js +1 -0
  73. package/dist/__synced__/types/components/step-indicator.synced.d.ts +44 -0
  74. package/dist/__synced__/types/components/step-indicator.synced.js +1 -0
  75. package/dist/__synced__/types/components/table.synced.d.ts +138 -0
  76. package/dist/__synced__/types/components/table.synced.js +1 -0
  77. package/dist/__synced__/types/components/tabs.synced.d.ts +55 -0
  78. package/dist/__synced__/types/components/tabs.synced.js +1 -0
  79. package/dist/__synced__/types/components/tag.synced.d.ts +32 -0
  80. package/dist/__synced__/types/components/tag.synced.js +1 -0
  81. package/dist/__synced__/types/components/text.synced.d.ts +93 -0
  82. package/dist/__synced__/types/components/text.synced.js +1 -0
  83. package/dist/__synced__/types/components/tile.synced.d.ts +24 -0
  84. package/dist/__synced__/types/components/tile.synced.js +1 -0
  85. package/dist/__synced__/types/components/toggle.synced.d.ts +60 -0
  86. package/dist/__synced__/types/components/toggle.synced.js +1 -0
  87. package/dist/__synced__/types/components/toggleInputs.synced.d.ts +191 -0
  88. package/dist/__synced__/types/components/toggleInputs.synced.js +1 -0
  89. package/dist/__synced__/types/components/tooltip.synced.d.ts +12 -0
  90. package/dist/__synced__/types/components/tooltip.synced.js +1 -0
  91. package/dist/__synced__/types/context.synced.d.ts +82 -0
  92. package/dist/__synced__/types/context.synced.js +1 -0
  93. package/dist/__synced__/types/crm.synced.d.ts +248 -0
  94. package/dist/__synced__/types/crm.synced.js +1 -0
  95. package/dist/__synced__/types/extension-points.synced.d.ts +122 -0
  96. package/dist/__synced__/types/extension-points.synced.js +9 -0
  97. package/dist/__synced__/types/http-requests.synced.d.ts +106 -0
  98. package/dist/__synced__/types/http-requests.synced.js +8 -0
  99. package/dist/__synced__/types/index.synced.d.ts +8 -0
  100. package/dist/__synced__/types/index.synced.js +9 -0
  101. package/dist/__synced__/types/reactions.synced.d.ts +12 -0
  102. package/dist/__synced__/types/reactions.synced.js +1 -0
  103. package/dist/__synced__/types/shared.synced.d.ts +197 -0
  104. package/dist/__synced__/types/shared.synced.js +179 -0
  105. package/dist/coreComponents.d.ts +21 -5
  106. package/dist/coreComponents.js +23 -1
  107. package/dist/crm/hooks/useAssociations.d.ts +3 -0
  108. package/dist/crm/hooks/useAssociations.js +3 -5
  109. package/dist/crm/hooks/useCrmProperties.d.ts +0 -2
  110. package/dist/crm/hooks/useCrmProperties.js +0 -7
  111. package/dist/crm/index.d.ts +2 -2
  112. package/dist/crm/index.js +1 -2
  113. package/dist/experimental/index.d.ts +2 -79
  114. package/dist/experimental/index.js +1 -36
  115. package/dist/experimental/testing/internal/types-internal.d.ts +47 -0
  116. package/dist/experimental/testing/internal/types-internal.js +1 -0
  117. package/dist/experimental/testing/type-utils.d.ts +29 -0
  118. package/dist/experimental/testing/type-utils.js +37 -0
  119. package/dist/experimental/testing/types.d.ts +240 -0
  120. package/dist/experimental/testing/types.js +10 -0
  121. package/dist/experimental/types.d.ts +4 -9
  122. package/dist/pages/home/index.d.ts +1 -0
  123. package/dist/pages/home/index.js +1 -0
  124. package/dist/types.d.ts +90 -4
  125. package/dist/types.js +0 -3
  126. package/package.json +4 -7
  127. package/dist/crm/components.js +0 -15
  128. package/dist/experimental/testing/index.d.ts +0 -14
  129. package/dist/experimental/testing/index.js +0 -33
  130. package/dist/experimental/testing/jest/matchers/index.d.ts +0 -6
  131. package/dist/experimental/testing/jest/matchers/index.js +0 -6
  132. package/dist/utils/createExtensionComponent.d.ts +0 -3
  133. package/dist/utils/createExtensionComponent.js +0 -4
@@ -1,4 +1,4 @@
1
- import { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions } from './components';
2
- export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions, };
1
+ export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions, } from '../__synced__/crmRemoteComponents.synced';
3
2
  export { useCrmProperties } from './hooks/useCrmProperties';
4
3
  export { useAssociations } from './hooks/useAssociations';
4
+ export type * from '../__synced__/types/crm.synced';
package/dist/crm/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions, } from './components';
2
- export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions, };
1
+ export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions, } from '../__synced__/crmRemoteComponents.synced';
3
2
  export { useCrmProperties } from './hooks/useCrmProperties';
4
3
  export { useAssociations } from './hooks/useAssociations';
@@ -1,81 +1,4 @@
1
- import type * as types from '../types';
2
- import type * as experimentalTypes from './types';
3
1
  export { useCrmProperties } from '../crm/hooks/useCrmProperties';
4
2
  export { useAssociations } from '../crm/hooks/useAssociations';
5
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
6
- declare const Iframe: "Iframe" & {
7
- readonly type?: "Iframe" | undefined;
8
- readonly props?: types.IframeProps | undefined;
9
- readonly children?: true | undefined;
10
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Iframe", types.IframeProps, true>>;
11
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
12
- declare const MediaObject: "MediaObject" & {
13
- readonly type?: "MediaObject" | undefined;
14
- readonly props?: experimentalTypes.MediaObjectProps | undefined;
15
- readonly children?: true | undefined;
16
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"MediaObject", experimentalTypes.MediaObjectProps, true>>;
17
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
18
- declare const Stack2: "Stack2" & {
19
- readonly type?: "Stack2" | undefined;
20
- readonly props?: experimentalTypes.Stack2Props | undefined;
21
- readonly children?: true | undefined;
22
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Stack2", experimentalTypes.Stack2Props, true>>;
23
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
24
- declare const Center: "Center" & {
25
- readonly type?: "Center" | undefined;
26
- readonly props?: experimentalTypes.CenterProps | undefined;
27
- readonly children?: true | undefined;
28
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Center", experimentalTypes.CenterProps, true>>;
29
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
30
- declare const SimpleGrid: "SimpleGrid" & {
31
- readonly type?: "SimpleGrid" | undefined;
32
- readonly props?: experimentalTypes.SimpleGridProps | undefined;
33
- readonly children?: true | undefined;
34
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"SimpleGrid", experimentalTypes.SimpleGridProps, true>>;
35
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
36
- declare const Grid: "Grid" & {
37
- readonly type?: "Grid" | undefined;
38
- readonly props?: experimentalTypes.GridProps | undefined;
39
- readonly children?: true | undefined;
40
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Grid", experimentalTypes.GridProps, true>>;
41
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
42
- declare const GridItem: "GridItem" & {
43
- readonly type?: "GridItem" | undefined;
44
- readonly props?: experimentalTypes.GridItemProps | undefined;
45
- readonly children?: true | undefined;
46
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"GridItem", experimentalTypes.GridItemProps, true>>;
47
- declare const SettingsView: "SettingsView" & {
48
- readonly type?: "SettingsView" | undefined;
49
- readonly props?: experimentalTypes.SettingsViewProps | undefined;
50
- readonly children?: true | undefined;
51
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"SettingsView", experimentalTypes.SettingsViewProps, true>>;
52
- /**
53
- * The `ExpandableText` component renders a text that can be expanded or collapsed based on a maximum height.
54
- *
55
- * **Links:**
56
- *
57
- * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/expandable-text ExpandableText Docs}
58
- */
59
- declare const ExpandableText: "ExpandableText" & {
60
- readonly type?: "ExpandableText" | undefined;
61
- readonly props?: experimentalTypes.ExpandableTextProps | undefined;
62
- readonly children?: true | undefined;
63
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"ExpandableText", experimentalTypes.ExpandableTextProps, true>>;
64
- /**
65
- * The `Popover` component renders a popover overlay that can contain other components.
66
- *
67
- * **Links:**
68
- *
69
- * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/popover Popover Docs}
70
- */
71
- declare const Popover: "Popover" & {
72
- readonly type?: "Popover" | undefined;
73
- readonly props?: experimentalTypes.PopoverProps | undefined;
74
- readonly children?: true | undefined;
75
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Popover", experimentalTypes.PopoverProps, true>>;
76
- declare const FileInput: "FileInput" & {
77
- readonly type?: "FileInput" | undefined;
78
- readonly props?: experimentalTypes.FileInputProps | undefined;
79
- readonly children?: true | undefined;
80
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"FileInput", experimentalTypes.FileInputProps, true>>;
81
- export { Iframe, MediaObject, Stack2, Center, SimpleGrid, GridItem, Grid, SettingsView, ExpandableText, Popover, FileInput, };
3
+ export { Iframe, MediaObject, Stack2, Center, GridItem, Grid, SettingsView, ExpandableText, Popover, FileInput, } from '../__synced__/experimentalRemoteComponents.synced';
4
+ export type * from '../__synced__/experimental/types.synced';
@@ -1,38 +1,3 @@
1
- import { createRemoteReactComponent } from '@remote-ui/react';
2
1
  export { useCrmProperties } from '../crm/hooks/useCrmProperties';
3
2
  export { useAssociations } from '../crm/hooks/useAssociations';
4
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
5
- const Iframe = createRemoteReactComponent('Iframe');
6
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
7
- const MediaObject = createRemoteReactComponent('MediaObject', {
8
- fragmentProps: ['itemRight', 'itemLeft'],
9
- });
10
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
11
- const Stack2 = createRemoteReactComponent('Stack2');
12
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
13
- const Center = createRemoteReactComponent('Center');
14
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
15
- const SimpleGrid = createRemoteReactComponent('SimpleGrid');
16
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
17
- const Grid = createRemoteReactComponent('Grid');
18
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
19
- const GridItem = createRemoteReactComponent('GridItem');
20
- const SettingsView = createRemoteReactComponent('SettingsView');
21
- /**
22
- * The `ExpandableText` component renders a text that can be expanded or collapsed based on a maximum height.
23
- *
24
- * **Links:**
25
- *
26
- * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/expandable-text ExpandableText Docs}
27
- */
28
- const ExpandableText = createRemoteReactComponent('ExpandableText');
29
- /**
30
- * The `Popover` component renders a popover overlay that can contain other components.
31
- *
32
- * **Links:**
33
- *
34
- * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/popover Popover Docs}
35
- */
36
- const Popover = createRemoteReactComponent('Popover');
37
- const FileInput = createRemoteReactComponent('FileInput');
38
- export { Iframe, MediaObject, Stack2, Center, SimpleGrid, GridItem, Grid, SettingsView, ExpandableText, Popover, FileInput, };
3
+ export { Iframe, MediaObject, Stack2, Center, GridItem, Grid, SettingsView, ExpandableText, Popover, FileInput, } from '../__synced__/experimentalRemoteComponents.synced';
@@ -0,0 +1,47 @@
1
+ import type { RemoteComponent, RemoteFragment, RemoteRoot, RemoteText } from '@remote-ui/core';
2
+ import type { RenderedElementNode, RenderedFragmentNode, RenderedNode, RenderedParentNode, RenderedRootNode, RenderedTextNode } from '../types';
3
+ export type RemoteChildNode = RemoteComponent<any, RemoteRoot> | RemoteText<RemoteRoot>;
4
+ export type RemoteParentNode = RemoteRoot | RemoteComponent<any, RemoteRoot> | RemoteFragment;
5
+ /**
6
+ * Represents a rendered document.
7
+ */
8
+ export interface RenderedDocumentInternal {
9
+ /**
10
+ * The root node of the document.
11
+ */
12
+ rootNode: RenderedRootNodeInternal | null;
13
+ /**
14
+ * Adds the name of an invalid component to the document.
15
+ *
16
+ * @param name The name of the invalid component.
17
+ */
18
+ addInvalidComponentName: (name: string) => void;
19
+ /**
20
+ * @returns the names of the invalid components.
21
+ */
22
+ getInvalidComponentNames: () => string[];
23
+ /**
24
+ * @returns Returns `true` if the document has invalid component types. `false` otherwise.
25
+ */
26
+ hasInvalidComponentNames: () => boolean;
27
+ /**
28
+ * Used to wrap the execution of a function that updates the rendered DOM.
29
+ * This is used to validate the rendered DOM after the function has been executed.
30
+ *
31
+ * @param run The function to execute.
32
+ */
33
+ batchUpdate: (run: () => void) => void;
34
+ }
35
+ /**
36
+ * Adds the `document` property to the rendered node. We do not include this in the public types because it is not
37
+ * part of the public API, but we need it for internal use.
38
+ */
39
+ type MakeRenderedNodeInternal<TRenderedNode extends RenderedNode> = TRenderedNode & {
40
+ document: RenderedDocumentInternal;
41
+ };
42
+ export type RenderedElementNodeInternal = MakeRenderedNodeInternal<RenderedElementNode>;
43
+ export type RenderedTextNodeInternal = MakeRenderedNodeInternal<RenderedTextNode>;
44
+ export type RenderedRootNodeInternal = MakeRenderedNodeInternal<RenderedRootNode>;
45
+ export type RenderedFragmentNodeInternal = MakeRenderedNodeInternal<RenderedFragmentNode>;
46
+ export type RenderedParentNodeInternal = MakeRenderedNodeInternal<RenderedParentNode>;
47
+ export {};
@@ -0,0 +1,29 @@
1
+ import { type RenderedElementNode, type RenderedFragmentNode, type RenderedNode, type RenderedRootNode, type RenderedTextNode } from './types';
2
+ /**
3
+ * Type guard to check if a node is a rendered element node.
4
+ *
5
+ * @param node The node to check.
6
+ * @returns `true` if the node is a rendered element node.
7
+ */
8
+ export declare const isRenderedElementNode: (node: RenderedNode | null | undefined) => node is RenderedElementNode<import("../..").UnknownComponentProps>;
9
+ /**
10
+ * Type guard to check if a node is a rendered text node.
11
+ *
12
+ * @param node The node to check.
13
+ * @returns `true` if the node is a rendered text node.
14
+ */
15
+ export declare const isRenderedTextNode: (node: RenderedNode | null | undefined) => node is RenderedTextNode;
16
+ /**
17
+ * Type guard to check if a node is a rendered root node.
18
+ *
19
+ * @param node The node to check.
20
+ * @returns `true` if the node is a rendered root node.
21
+ */
22
+ export declare const isRenderedRootNode: (node: RenderedNode | null | undefined) => node is RenderedRootNode;
23
+ /**
24
+ * Type guard to check if a node is a rendered fragment node.
25
+ *
26
+ * @param node The node to check.
27
+ * @returns `true` if the node is a rendered fragment node.
28
+ */
29
+ export declare const isRenderedFragmentNode: (node: RenderedNode | null | undefined) => node is RenderedFragmentNode;
@@ -0,0 +1,37 @@
1
+ import { RenderedNodeType, } from './types';
2
+ /**
3
+ * Type guard to check if a node is a rendered element node.
4
+ *
5
+ * @param node The node to check.
6
+ * @returns `true` if the node is a rendered element node.
7
+ */
8
+ export const isRenderedElementNode = (node) => {
9
+ return node?.nodeType === RenderedNodeType.Element;
10
+ };
11
+ /**
12
+ * Type guard to check if a node is a rendered text node.
13
+ *
14
+ * @param node The node to check.
15
+ * @returns `true` if the node is a rendered text node.
16
+ */
17
+ export const isRenderedTextNode = (node) => {
18
+ return node?.nodeType === RenderedNodeType.Text;
19
+ };
20
+ /**
21
+ * Type guard to check if a node is a rendered root node.
22
+ *
23
+ * @param node The node to check.
24
+ * @returns `true` if the node is a rendered root node.
25
+ */
26
+ export const isRenderedRootNode = (node) => {
27
+ return node?.nodeType === RenderedNodeType.Root;
28
+ };
29
+ /**
30
+ * Type guard to check if a node is a rendered fragment node.
31
+ *
32
+ * @param node The node to check.
33
+ * @returns `true` if the node is a rendered fragment node.
34
+ */
35
+ export const isRenderedFragmentNode = (node) => {
36
+ return node?.nodeType === RenderedNodeType.Fragment;
37
+ };
@@ -0,0 +1,240 @@
1
+ import { HubSpotReactComponent, HubSpotReactFragmentProp, UnknownComponentProps } from '../../types';
2
+ /**
3
+ * The type of a rendered node.
4
+ */
5
+ export declare enum RenderedNodeType {
6
+ Root = "root",
7
+ Fragment = "fragment",
8
+ Element = "element",
9
+ Text = "text"
10
+ }
11
+ /**
12
+ * Extracts event property names from a props type, filtering for properties that are functions
13
+ */
14
+ type EventNamesForProps<TProps extends UnknownComponentProps> = {
15
+ [K in keyof Required<TProps>]: Required<TProps>[K] extends Function ? K : never;
16
+ }[keyof TProps];
17
+ interface CommonQueryMethods {
18
+ /**
19
+ * Finds the first descendant element node that matches the given component.
20
+ *
21
+ * @param component The component to find.
22
+ * @param matcher An optional matcher to filter the elements.
23
+ * @returns The first element node that matches the given component or `null` if no match is found.
24
+ */
25
+ maybeFind<TProps extends UnknownComponentProps>(component: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps>): RenderedElementNode<TProps> | null;
26
+ /**
27
+ * Finds the first descendant element node that matches the given component. If no match is found, an error will be thrown.
28
+ *
29
+ * @param component The component to find.
30
+ * @param matcher An optional matcher to filter the elements.
31
+ * @returns The first element node that matches the given component.
32
+ */
33
+ find<TProps extends UnknownComponentProps>(component: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps>): RenderedElementNode<TProps>;
34
+ /**
35
+ * Finds all descendant element nodes that match the given component.
36
+ *
37
+ * @param component The component to find.
38
+ * @param matcher An optional matcher to filter the elements.
39
+ * @returns An array of element nodes that match the given component.
40
+ */
41
+ findAll<TProps extends UnknownComponentProps>(component: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps>): RenderedElementNode<TProps>[];
42
+ /**
43
+ * Finds the first direct child element node that matches the given component.
44
+ *
45
+ * @param component The component to find.
46
+ * @param matcher An optional matcher to filter the elements.
47
+ * @returns The first child element node that matches the given component.
48
+ */
49
+ findChild<TProps extends UnknownComponentProps>(component: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps>): RenderedElementNode<TProps>;
50
+ /**
51
+ * Finds the first direct child element node that matches the given component.
52
+ *
53
+ * @param component The component to find.
54
+ * @param matcher An optional matcher to filter the elements.
55
+ * @returns The first child element node that matches the given component or `null` if no match is found.
56
+ */
57
+ maybeFindChild<TProps extends UnknownComponentProps>(component: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps>): RenderedElementNode<TProps> | null;
58
+ /**
59
+ * Finds all direct child element nodes that match the given component.
60
+ *
61
+ * @param component The component to find.
62
+ * @param matcher An optional matcher to filter the elements.
63
+ * @returns An array of child element nodes that match the given component.
64
+ */
65
+ findAllChildren<TProps extends UnknownComponentProps>(component: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps>): RenderedElementNode<TProps>[];
66
+ }
67
+ interface BaseRenderedParentNode {
68
+ /**
69
+ * The child nodes
70
+ */
71
+ children: RenderedChildNode[];
72
+ }
73
+ /**
74
+ * Represents a root node of a rendered component.
75
+ *
76
+ * NOTE: Rendered root nodes are immutable and are part of a snapshot for a single render cycle. They become immediately stale when a new render occurs.
77
+ */
78
+ export interface RenderedRootNode extends BaseRenderedParentNode, CommonQueryMethods {
79
+ /**
80
+ * The type of the node (always `RenderedNodeType.Root` for a root node).
81
+ */
82
+ nodeType: RenderedNodeType.Root;
83
+ /**
84
+ * The text content of the root node or `null` if the root node does not have any text content.
85
+ */
86
+ text: string | null;
87
+ /**
88
+ * Logs a string representation of the root node as a console log.
89
+ */
90
+ debugLog: (label?: string) => void;
91
+ /**
92
+ * Returns a string representation of the root node.
93
+ *
94
+ * @returns A string representation of the root node.
95
+ */
96
+ toString: () => string;
97
+ }
98
+ /**
99
+ * Represents a fragment node passed as a prop to a rendered component.
100
+ *
101
+ * NOTE: Rendered fragment nodes are immutable and are part of a snapshot for a single render cycle. They become immediately stale when a new render occurs.
102
+ */
103
+ export interface RenderedFragmentNode extends BaseRenderedParentNode, CommonQueryMethods {
104
+ /**
105
+ * The type of the node (always `RenderedNodeType.Fragment` for a fragment node).
106
+ */
107
+ nodeType: RenderedNodeType.Fragment;
108
+ /**
109
+ * The text content of the fragment node or `null` if the fragment node does not have any text content.
110
+ */
111
+ text: string | null;
112
+ /**
113
+ * Logs a string representation of the fragment node as a console log.
114
+ */
115
+ debugLog: (label?: string) => void;
116
+ /**
117
+ * Returns a string representation of the fragment node.
118
+ */
119
+ toString: () => string;
120
+ }
121
+ type RenderPropsFromComponentProps<TProps extends UnknownComponentProps> = {
122
+ [K in keyof TProps]: HubSpotReactFragmentProp extends TProps[K] ? RenderedFragmentNode : TProps[K];
123
+ };
124
+ /**
125
+ * Represents an element node of a rendered component.
126
+ *
127
+ * NOTE: Rendered elements are immutable and are part of a snapshot for a single render cycle. They become immediately stale when a new render occurs.
128
+ */
129
+ export interface RenderedElementNode<TProps extends UnknownComponentProps = UnknownComponentProps> extends BaseRenderedParentNode, CommonQueryMethods {
130
+ /**
131
+ * The type of the node (always `RenderedNodeType.Element` for an element node).
132
+ */
133
+ nodeType: RenderedNodeType.Element;
134
+ /**
135
+ * The name of the element node.
136
+ */
137
+ name: string;
138
+ /**
139
+ * The props passed to the element node.
140
+ */
141
+ props: RenderPropsFromComponentProps<TProps>;
142
+ /**
143
+ * The text content of the element node or `null` if the element node does not have any text content.
144
+ */
145
+ text: string | null;
146
+ /**
147
+ * Logs a string representation of the element node as a console log.
148
+ *
149
+ * @param label The label to log.
150
+ */
151
+ debugLog: (label?: string) => void;
152
+ /**
153
+ * Returns a string representation of the element node.
154
+ */
155
+ toString: () => string;
156
+ /**
157
+ * Triggers an event function on the element node.
158
+ *
159
+ * @param eventPropName The name of the event to trigger.
160
+ * @param eventArg The argument to pass to the event.
161
+ */
162
+ trigger<TEventPropName extends EventNamesForProps<TProps>>(eventPropName: TEventPropName, eventArg?: TProps[TEventPropName]): void;
163
+ }
164
+ /**
165
+ * Represents a text node of a rendered component.
166
+ *
167
+ * NOTE: Rendered text nodes are immutable and are part of a snapshot for a single render cycle. They become immediately stale when a new render occurs.
168
+ */
169
+ export interface RenderedTextNode {
170
+ /**
171
+ * The type of the node (always `RenderedNodeType.Text` for a text node).
172
+ */
173
+ nodeType: RenderedNodeType.Text;
174
+ /**
175
+ * The text content of the text node.
176
+ */
177
+ text: string;
178
+ /**
179
+ * Returns a string representation of the text node.
180
+ */
181
+ toString: () => string;
182
+ }
183
+ /**
184
+ * Represents a child node of a parent node.
185
+ *
186
+ * NOTE: Rendered child nodes are immutable and are part of a snapshot for a single render cycle. They become immediately stale when a new render occurs.
187
+ */
188
+ export type RenderedChildNode = RenderedElementNode<UnknownComponentProps> | RenderedTextNode;
189
+ /**
190
+ * Represents a parent node of a rendered component.
191
+ *
192
+ * NOTE: Rendered parent nodes are immutable and are part of a snapshot for a single render cycle. They become immediately stale when a new render occurs.
193
+ */
194
+ export type RenderedParentNode = RenderedElementNode<UnknownComponentProps> | RenderedRootNode | RenderedFragmentNode;
195
+ /**
196
+ * A predicate that matches an element node.
197
+ *
198
+ * @param node The node to match.
199
+ * @returns Whether the node matches the predicate.
200
+ */
201
+ export type ElementMatcherPredicate<TProps extends UnknownComponentProps> = (node: RenderedElementNode<TProps>) => boolean;
202
+ /**
203
+ * A matcher that matches an element node based on either a predicate or a partial set of properties.
204
+ */
205
+ export type ElementMatcher<TProps extends UnknownComponentProps> = ElementMatcherPredicate<TProps> | Partial<TProps>;
206
+ /**
207
+ * Options for the waitFor function.
208
+ */
209
+ export interface WaitForOptions {
210
+ /**
211
+ * The timeout in milliseconds. Defaults to 1000.
212
+ */
213
+ timeoutInMs?: number;
214
+ }
215
+ /**
216
+ * A result of a render operation.
217
+ */
218
+ export interface RenderResult extends CommonQueryMethods {
219
+ /**
220
+ * Waits for the given check to pass. If the check does not pass within the allowed amount of time, an error will be thrown.
221
+ *
222
+ * @param check The check to wait for.
223
+ * @returns A promise that resolves when the check passes.
224
+ */
225
+ waitFor: (check: () => void, options?: WaitForOptions) => Promise<void>;
226
+ /**
227
+ * Logs a string representation of the rendered output as a console log.
228
+ *
229
+ * @param label The label to log.
230
+ */
231
+ debugLog: (label?: string) => void;
232
+ /**
233
+ * Returns the root node.
234
+ *
235
+ * @returns The root node.
236
+ */
237
+ getRootNode: () => RenderedRootNode;
238
+ }
239
+ export type RenderedNode = RenderedElementNode<any> | RenderedRootNode | RenderedFragmentNode | RenderedTextNode;
240
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The type of a rendered node.
3
+ */
4
+ export var RenderedNodeType;
5
+ (function (RenderedNodeType) {
6
+ RenderedNodeType["Root"] = "root";
7
+ RenderedNodeType["Fragment"] = "fragment";
8
+ RenderedNodeType["Element"] = "element";
9
+ RenderedNodeType["Text"] = "text";
10
+ })(RenderedNodeType || (RenderedNodeType = {}));
@@ -48,15 +48,6 @@ export interface MediaObjectProps {
48
48
  itemLeft?: RemoteFragment;
49
49
  itemRight?: RemoteFragment;
50
50
  }
51
- /**
52
- * @ignore
53
- * @experimental do not use in production
54
- */
55
- export interface SimpleGridProps extends BaseLayout {
56
- minColumnWidth: number | string;
57
- gap?: AllDistances;
58
- children?: ReactNode;
59
- }
60
51
  export interface GridProps {
61
52
  justify?: FlexJustify;
62
53
  align?: FlexAlign;
@@ -151,6 +142,10 @@ export interface PopoverProps {
151
142
  */
152
143
  arrowSize?: 'none' | 'small' | 'medium';
153
144
  }
145
+ /**
146
+ * @ignore
147
+ * @experimental do not use in production
148
+ */
154
149
  export interface FileInputProps {
155
150
  value?: File | {
156
151
  name: string;
@@ -0,0 +1 @@
1
+ export type { HeaderActions, PrimaryHeaderActionButton, SecondaryHeaderActionButton, } from '../../__synced__/appHomeRemoteComponents.synced';
@@ -0,0 +1 @@
1
+ export {};