@arcgis/instant-apps-components-react 4.34.0-next.9 → 4.34.0-next.91

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/README.md CHANGED
@@ -1,43 +1,41 @@
1
1
  # Instant Apps Components React
2
2
 
3
- A set of React components that wrap [Instant Apps Components](https://github.com/Esri/instant-apps-components).
3
+ A set of React components that wrap [Instant Apps Components](https://npmjs.com/package/@arcgis/instant-apps-components).
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```sh
8
- npm install --save @esri/instant-apps-components-react
8
+ npm install --save @arcgis/instant-apps-components-react
9
9
  ```
10
10
 
11
- This package includes the compatible version of the main component library as a dependency, so no need to install `@esri/instant-apps-components` separately.
11
+ This package includes the compatible version of the main component library as a dependency, so no need to install `@arcgis/instant-apps-components` separately.
12
12
 
13
13
  Once installed, you need to import each component you use from the standard `instant-apps-component` package's custom elements build. This will automatically define the custom elements on the window. Then import the same components from `instant-apps-components-react`.
14
14
 
15
15
  ```jsx
16
- import "@esri/instant-apps-components/dist/components/instant-apps-header";
17
- import "@esri/instant-apps-components/dist/components/instant-apps-social-share";
18
- import { InstantAppsHeader, InstantAppsSocialShare } from "@esri/instant-apps-components-react";
16
+ import "@arcgis/instant-apps-components/dist/components/instant-apps-header";
17
+ import "@arcgis/instant-apps-components/dist/components/instant-apps-social-share";
18
+ import { InstantAppsHeader, InstantAppsSocialShare } from "@arcgis/instant-apps-components-react";
19
19
  ```
20
20
 
21
- ## Why not just use the web components directly?
22
-
23
- Because React uses a synthetic event system, the custom events emitted from instant apps components won't work with JSX in React.
24
-
25
- If you're using TypeScript, you'll also get increased type safety for your event listeners, props, etc.
26
-
27
21
  ## Contributing
28
22
 
29
23
  We welcome contributions to this project. See the main [instant-apps-components CONTRIBUTING.md](https://github.com/Esri/instant-apps-components/blob/master/CONTRIBUTING.md) for an overview of contribution guidelines.
30
24
 
31
25
  ## License
32
26
 
33
- COPYRIGHT © 2023 Esri
27
+ COPYRIGHT © 2025 Esri
34
28
 
35
29
  All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
36
30
 
37
- This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement. You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
38
-
39
- See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
31
+ This material is licensed for use under the [Esri Master License Agreement (MLA)](https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf), and is bound by the terms of that agreement.
32
+ You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
40
33
 
41
- For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, USA 92373 USA
34
+ For additional information, contact:
35
+ Environmental Systems Research Institute, Inc.
36
+ Attn: Contracts and Legal Services Department
37
+ 380 New York Street
38
+ Redlands, California, USA 92373
39
+ USA
42
40
 
43
- email: contracts@esri.com
41
+ email: legal@esri.com
@@ -1,34 +1,137 @@
1
- import type { JSX } from '@arcgis/instant-apps-components';
2
- export declare const InstantAppsAppGuide: import("react").ForwardRefExoticComponent<JSX.InstantAppsAppGuide & Omit<import("react").HTMLAttributes<HTMLInstantAppsAppGuideElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsAppGuideElement>>;
3
- export declare const InstantAppsCkeditorWrapper: import("react").ForwardRefExoticComponent<JSX.InstantAppsCkeditorWrapper & Omit<import("react").HTMLAttributes<HTMLInstantAppsCkeditorWrapperElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsCkeditorWrapperElement>>;
4
- export declare const InstantAppsControlPanel: import("react").ForwardRefExoticComponent<JSX.InstantAppsControlPanel & Omit<import("react").HTMLAttributes<HTMLInstantAppsControlPanelElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsControlPanelElement>>;
5
- export declare const InstantAppsCreate: import("react").ForwardRefExoticComponent<JSX.InstantAppsCreate & Omit<import("react").HTMLAttributes<HTMLInstantAppsCreateElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsCreateElement>>;
6
- export declare const InstantAppsExport: import("react").ForwardRefExoticComponent<JSX.InstantAppsExport & Omit<import("react").HTMLAttributes<HTMLInstantAppsExportElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsExportElement>>;
7
- export declare const InstantAppsExportViews: import("react").ForwardRefExoticComponent<JSX.InstantAppsExportViews & Omit<import("react").HTMLAttributes<HTMLInstantAppsExportViewsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsExportViewsElement>>;
8
- export declare const InstantAppsFilterList: import("react").ForwardRefExoticComponent<JSX.InstantAppsFilterList & Omit<import("react").HTMLAttributes<HTMLInstantAppsFilterListElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsFilterListElement>>;
9
- export declare const InstantAppsHeader: import("react").ForwardRefExoticComponent<JSX.InstantAppsHeader & Omit<import("react").HTMLAttributes<HTMLInstantAppsHeaderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsHeaderElement>>;
10
- export declare const InstantAppsInteractiveLegend: import("react").ForwardRefExoticComponent<JSX.InstantAppsInteractiveLegend & Omit<import("react").HTMLAttributes<HTMLInstantAppsInteractiveLegendElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsInteractiveLegendElement>>;
11
- export declare const InstantAppsInteractiveLegendClassic: import("react").ForwardRefExoticComponent<JSX.InstantAppsInteractiveLegendClassic & Omit<import("react").HTMLAttributes<HTMLInstantAppsInteractiveLegendClassicElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsInteractiveLegendClassicElement>>;
12
- export declare const InstantAppsInteractiveLegendCount: import("react").ForwardRefExoticComponent<JSX.InstantAppsInteractiveLegendCount & Omit<import("react").HTMLAttributes<HTMLInstantAppsInteractiveLegendCountElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsInteractiveLegendCountElement>>;
13
- export declare const InstantAppsInteractiveLegendGroupLegendElement: import("react").ForwardRefExoticComponent<JSX.InstantAppsInteractiveLegendGroupLegendElement & Omit<import("react").HTMLAttributes<HTMLInstantAppsInteractiveLegendGroupLegendElementElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsInteractiveLegendGroupLegendElementElement>>;
14
- export declare const InstantAppsInteractiveLegendGroupLegendElementCaption: import("react").ForwardRefExoticComponent<JSX.InstantAppsInteractiveLegendGroupLegendElementCaption & Omit<import("react").HTMLAttributes<HTMLInstantAppsInteractiveLegendGroupLegendElementCaptionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsInteractiveLegendGroupLegendElementCaptionElement>>;
15
- export declare const InstantAppsInteractiveLegendLayerElement: import("react").ForwardRefExoticComponent<JSX.InstantAppsInteractiveLegendLayerElement & Omit<import("react").HTMLAttributes<HTMLInstantAppsInteractiveLegendLayerElementElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsInteractiveLegendLayerElementElement>>;
16
- export declare const InstantAppsInteractiveLegendLayerElementCaption: import("react").ForwardRefExoticComponent<JSX.InstantAppsInteractiveLegendLayerElementCaption & Omit<import("react").HTMLAttributes<HTMLInstantAppsInteractiveLegendLayerElementCaptionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsInteractiveLegendLayerElementCaptionElement>>;
17
- export declare const InstantAppsInteractiveLegendLegendElement: import("react").ForwardRefExoticComponent<JSX.InstantAppsInteractiveLegendLegendElement & Omit<import("react").HTMLAttributes<HTMLInstantAppsInteractiveLegendLegendElementElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsInteractiveLegendLegendElementElement>>;
18
- export declare const InstantAppsInteractiveLegendLegendElementCaption: import("react").ForwardRefExoticComponent<JSX.InstantAppsInteractiveLegendLegendElementCaption & Omit<import("react").HTMLAttributes<HTMLInstantAppsInteractiveLegendLegendElementCaptionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsInteractiveLegendLegendElementCaptionElement>>;
19
- export declare const InstantAppsInteractiveLegendRelationship: import("react").ForwardRefExoticComponent<JSX.InstantAppsInteractiveLegendRelationship & Omit<import("react").HTMLAttributes<HTMLInstantAppsInteractiveLegendRelationshipElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsInteractiveLegendRelationshipElement>>;
20
- export declare const InstantAppsKeyboardShortcuts: import("react").ForwardRefExoticComponent<JSX.InstantAppsKeyboardShortcuts & Omit<import("react").HTMLAttributes<HTMLInstantAppsKeyboardShortcutsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsKeyboardShortcutsElement>>;
21
- export declare const InstantAppsLandingPage: import("react").ForwardRefExoticComponent<JSX.InstantAppsLandingPage & Omit<import("react").HTMLAttributes<HTMLInstantAppsLandingPageElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsLandingPageElement>>;
22
- export declare const InstantAppsLanguageSwitcher: import("react").ForwardRefExoticComponent<JSX.InstantAppsLanguageSwitcher & Omit<import("react").HTMLAttributes<HTMLInstantAppsLanguageSwitcherElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsLanguageSwitcherElement>>;
23
- export declare const InstantAppsLanguageTranslator: import("react").ForwardRefExoticComponent<JSX.InstantAppsLanguageTranslator & Omit<import("react").HTMLAttributes<HTMLInstantAppsLanguageTranslatorElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsLanguageTranslatorElement>>;
24
- export declare const InstantAppsLanguageTranslatorItem: import("react").ForwardRefExoticComponent<JSX.InstantAppsLanguageTranslatorItem & Omit<import("react").HTMLAttributes<HTMLInstantAppsLanguageTranslatorItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsLanguageTranslatorItemElement>>;
25
- export declare const InstantAppsLanguageTranslatorSearch: import("react").ForwardRefExoticComponent<JSX.InstantAppsLanguageTranslatorSearch & Omit<import("react").HTMLAttributes<HTMLInstantAppsLanguageTranslatorSearchElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsLanguageTranslatorSearchElement>>;
26
- export declare const InstantAppsMeasurement: import("react").ForwardRefExoticComponent<JSX.InstantAppsMeasurement & Omit<import("react").HTMLAttributes<HTMLInstantAppsMeasurementElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsMeasurementElement>>;
27
- export declare const InstantAppsMeasurementTool: import("react").ForwardRefExoticComponent<JSX.InstantAppsMeasurementTool & Omit<import("react").HTMLAttributes<HTMLInstantAppsMeasurementToolElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsMeasurementToolElement>>;
28
- export declare const InstantAppsPopover: import("react").ForwardRefExoticComponent<JSX.InstantAppsPopover & Omit<import("react").HTMLAttributes<HTMLInstantAppsPopoverElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsPopoverElement>>;
29
- export declare const InstantAppsPopovers: import("react").ForwardRefExoticComponent<JSX.InstantAppsPopovers & Omit<import("react").HTMLAttributes<HTMLInstantAppsPopoversElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsPopoversElement>>;
30
- export declare const InstantAppsScoreboard: import("react").ForwardRefExoticComponent<JSX.InstantAppsScoreboard & Omit<import("react").HTMLAttributes<HTMLInstantAppsScoreboardElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsScoreboardElement>>;
31
- export declare const InstantAppsSignIn: import("react").ForwardRefExoticComponent<JSX.InstantAppsSignIn & Omit<import("react").HTMLAttributes<HTMLInstantAppsSignInElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsSignInElement>>;
32
- export declare const InstantAppsSocialShare: import("react").ForwardRefExoticComponent<JSX.InstantAppsSocialShare & Omit<import("react").HTMLAttributes<HTMLInstantAppsSocialShareElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsSocialShareElement>>;
33
- export declare const InstantAppsSplash: import("react").ForwardRefExoticComponent<JSX.InstantAppsSplash & Omit<import("react").HTMLAttributes<HTMLInstantAppsSplashElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsSplashElement>>;
34
- export declare const InstantAppsTimeFilter: import("react").ForwardRefExoticComponent<JSX.InstantAppsTimeFilter & Omit<import("react").HTMLAttributes<HTMLInstantAppsTimeFilterElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLInstantAppsTimeFilterElement>>;
1
+ /// <reference types="@arcgis/instant-apps-components" preserve="true" />
2
+ import { EventName } from '@lit/react';
3
+ export declare const InstantAppsAppGuide: import('@lit/react').ReactWebComponent<HTMLInstantAppsAppGuideElement & {
4
+ class?: string;
5
+ }, {}>;
6
+ export declare const InstantAppsControlPanel: import('@lit/react').ReactWebComponent<HTMLInstantAppsControlPanelElement & {
7
+ class?: string;
8
+ }, {}>;
9
+ export declare const InstantAppsCreate: import('@lit/react').ReactWebComponent<HTMLInstantAppsCreateElement & {
10
+ class?: string;
11
+ }, {}>;
12
+ export declare const InstantAppsExport: import('@lit/react').ReactWebComponent<HTMLInstantAppsExportElement & {
13
+ class?: string;
14
+ }, {
15
+ onExportOutputUpdated: EventName<HTMLInstantAppsExportElement["exportOutputUpdated"]>;
16
+ }>;
17
+ export declare const InstantAppsExportViews: import('@lit/react').ReactWebComponent<HTMLInstantAppsExportViewsElement & {
18
+ class?: string;
19
+ }, {
20
+ onExportOutputUpdated: EventName<HTMLInstantAppsExportViewsElement["exportOutputUpdated"]>;
21
+ }>;
22
+ export declare const InstantAppsFilterList: import('@lit/react').ReactWebComponent<HTMLInstantAppsFilterListElement & {
23
+ class?: string;
24
+ }, {
25
+ onFilterListReset: EventName<HTMLInstantAppsFilterListElement["filterListReset"]>;
26
+ onFilterUpdate: EventName<HTMLInstantAppsFilterListElement["filterUpdate"]>;
27
+ }>;
28
+ export declare const InstantAppsHeader: import('@lit/react').ReactWebComponent<HTMLInstantAppsHeaderElement & {
29
+ class?: string;
30
+ }, {
31
+ onInfoIsOpenChanged: EventName<HTMLInstantAppsHeaderElement["infoIsOpenChanged"]>;
32
+ }>;
33
+ export declare const InstantAppsInteractiveLegend: import('@lit/react').ReactWebComponent<HTMLInstantAppsInteractiveLegendElement & {
34
+ class?: string;
35
+ }, {}>;
36
+ export declare const InstantAppsInteractiveLegendClassic: import('@lit/react').ReactWebComponent<HTMLInstantAppsInteractiveLegendClassicElement & {
37
+ class?: string;
38
+ }, {}>;
39
+ export declare const InstantAppsInteractiveLegendCount: import('@lit/react').ReactWebComponent<HTMLInstantAppsInteractiveLegendCountElement & {
40
+ class?: string;
41
+ }, {}>;
42
+ export declare const InstantAppsInteractiveLegendGroupLegendElement: import('@lit/react').ReactWebComponent<HTMLInstantAppsInteractiveLegendGroupLegendElementElement & {
43
+ class?: string;
44
+ }, {}>;
45
+ export declare const InstantAppsInteractiveLegendGroupLegendElementCaption: import('@lit/react').ReactWebComponent<HTMLInstantAppsInteractiveLegendGroupLegendElementCaptionElement & {
46
+ class?: string;
47
+ }, {
48
+ onGroupLayerCaptionElementExpandUpdated: EventName<HTMLInstantAppsInteractiveLegendGroupLegendElementCaptionElement["groupLayerCaptionElementExpandUpdated"]>;
49
+ }>;
50
+ export declare const InstantAppsInteractiveLegendLayerElement: import('@lit/react').ReactWebComponent<HTMLInstantAppsInteractiveLegendLayerElementElement & {
51
+ class?: string;
52
+ }, {}>;
53
+ export declare const InstantAppsInteractiveLegendLayerElementCaption: import('@lit/react').ReactWebComponent<HTMLInstantAppsInteractiveLegendLayerElementCaptionElement & {
54
+ class?: string;
55
+ }, {
56
+ onLayerCaptionElementExpandUpdated: EventName<HTMLInstantAppsInteractiveLegendLayerElementCaptionElement["layerCaptionElementExpandUpdated"]>;
57
+ }>;
58
+ export declare const InstantAppsInteractiveLegendLegendElement: import('@lit/react').ReactWebComponent<HTMLInstantAppsInteractiveLegendLegendElementElement & {
59
+ class?: string;
60
+ }, {}>;
61
+ export declare const InstantAppsInteractiveLegendLegendElementCaption: import('@lit/react').ReactWebComponent<HTMLInstantAppsInteractiveLegendLegendElementCaptionElement & {
62
+ class?: string;
63
+ }, {
64
+ onLegendLayerExpandUpdated: EventName<HTMLInstantAppsInteractiveLegendLegendElementCaptionElement["legendLayerExpandUpdated"]>;
65
+ onShowAllSelected: EventName<HTMLInstantAppsInteractiveLegendLegendElementCaptionElement["showAllSelected"]>;
66
+ }>;
67
+ export declare const InstantAppsInteractiveLegendRelationship: import('@lit/react').ReactWebComponent<HTMLInstantAppsInteractiveLegendRelationshipElement & {
68
+ class?: string;
69
+ }, {}>;
70
+ export declare const InstantAppsKeyboardShortcuts: import('@lit/react').ReactWebComponent<HTMLInstantAppsKeyboardShortcutsElement & {
71
+ class?: string;
72
+ }, {}>;
73
+ export declare const InstantAppsLandingPage: import('@lit/react').ReactWebComponent<HTMLInstantAppsLandingPageElement & {
74
+ class?: string;
75
+ }, {
76
+ onLandingPageClose: EventName<HTMLInstantAppsLandingPageElement["landingPageClose"]>;
77
+ onLandingPageOpen: EventName<HTMLInstantAppsLandingPageElement["landingPageOpen"]>;
78
+ }>;
79
+ export declare const InstantAppsLanguageSwitcher: import('@lit/react').ReactWebComponent<HTMLInstantAppsLanguageSwitcherElement & {
80
+ class?: string;
81
+ }, {
82
+ onSelectedLanguageUpdated: EventName<HTMLInstantAppsLanguageSwitcherElement["selectedLanguageUpdated"]>;
83
+ }>;
84
+ export declare const InstantAppsLanguageTranslator: import('@lit/react').ReactWebComponent<HTMLInstantAppsLanguageTranslatorElement & {
85
+ class?: string;
86
+ }, {
87
+ onTranslatorDataUpdated: EventName<HTMLInstantAppsLanguageTranslatorElement["translatorDataUpdated"]>;
88
+ }>;
89
+ export declare const InstantAppsCkeditorWrapper: import('@lit/react').ReactWebComponent<HTMLInstantAppsCkeditorWrapperElement & {
90
+ class?: string;
91
+ }, {
92
+ onDataChanged: EventName<HTMLInstantAppsCkeditorWrapperElement["dataChanged"]>;
93
+ onIsFocused: EventName<HTMLInstantAppsCkeditorWrapperElement["isFocused"]>;
94
+ }>;
95
+ export declare const InstantAppsLanguageTranslatorItem: import('@lit/react').ReactWebComponent<HTMLInstantAppsLanguageTranslatorItemElement & {
96
+ class?: string;
97
+ }, {
98
+ onTranslatorItemDataUpdated: EventName<HTMLInstantAppsLanguageTranslatorItemElement["translatorItemDataUpdated"]>;
99
+ }>;
100
+ export declare const InstantAppsLanguageTranslatorSearch: import('@lit/react').ReactWebComponent<HTMLInstantAppsLanguageTranslatorSearchElement & {
101
+ class?: string;
102
+ }, {
103
+ onSuggestionSelected: EventName<HTMLInstantAppsLanguageTranslatorSearchElement["suggestionSelected"]>;
104
+ }>;
105
+ export declare const InstantAppsMeasurement: import('@lit/react').ReactWebComponent<HTMLInstantAppsMeasurementElement & {
106
+ class?: string;
107
+ }, {
108
+ onMeasureActive: EventName<HTMLInstantAppsMeasurementElement["measureActive"]>;
109
+ }>;
110
+ export declare const InstantAppsMeasurementTool: import('@lit/react').ReactWebComponent<HTMLInstantAppsMeasurementToolElement & {
111
+ class?: string;
112
+ }, {}>;
113
+ export declare const InstantAppsPopover: import('@lit/react').ReactWebComponent<HTMLInstantAppsPopoverElement & {
114
+ class?: string;
115
+ }, {}>;
116
+ export declare const InstantAppsPopovers: import('@lit/react').ReactWebComponent<HTMLInstantAppsPopoversElement & {
117
+ class?: string;
118
+ }, {}>;
119
+ export declare const InstantAppsScoreboard: import('@lit/react').ReactWebComponent<HTMLInstantAppsScoreboardElement & {
120
+ class?: string;
121
+ }, {
122
+ onScoreboardItemsUpdated: EventName<HTMLInstantAppsScoreboardElement["scoreboardItemsUpdated"]>;
123
+ }>;
124
+ export declare const InstantAppsSignIn: import('@lit/react').ReactWebComponent<HTMLInstantAppsSignInElement & {
125
+ class?: string;
126
+ }, {}>;
127
+ export declare const InstantAppsSocialShare: import('@lit/react').ReactWebComponent<HTMLInstantAppsSocialShareElement & {
128
+ class?: string;
129
+ }, {}>;
130
+ export declare const InstantAppsSplash: import('@lit/react').ReactWebComponent<HTMLInstantAppsSplashElement & {
131
+ class?: string;
132
+ }, {
133
+ onSplashClose: EventName<HTMLInstantAppsSplashElement["splashClose"]>;
134
+ }>;
135
+ export declare const InstantAppsTimeFilter: import('@lit/react').ReactWebComponent<HTMLInstantAppsTimeFilterElement & {
136
+ class?: string;
137
+ }, {}>;
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./components";
1
+ export * from './components';
package/dist/index.js CHANGED
@@ -1 +1,240 @@
1
- export * from "./components";
1
+ import e from "react";
2
+ import { createComponent as a } from "@lit/react";
3
+ import { makeReactWrapperFactory as s, getReactWrapperOptions as t } from "@arcgis/lumina";
4
+ const n = /* @__PURE__ */ s(e, a), i = /* @__PURE__ */ n(
5
+ t(
6
+ "instant-apps-app-guide",
7
+ {}
8
+ )
9
+ ), d = /* @__PURE__ */ n(
10
+ t(
11
+ "instant-apps-control-panel",
12
+ {}
13
+ )
14
+ ), c = /* @__PURE__ */ n(
15
+ t(
16
+ "instant-apps-create",
17
+ {}
18
+ )
19
+ ), l = /* @__PURE__ */ n(
20
+ t(
21
+ "instant-apps-export",
22
+ {
23
+ onExportOutputUpdated: "exportOutputUpdated"
24
+ }
25
+ )
26
+ ), g = /* @__PURE__ */ n(
27
+ t(
28
+ "instant-apps-export-views",
29
+ {
30
+ onExportOutputUpdated: "exportOutputUpdated"
31
+ }
32
+ )
33
+ ), I = /* @__PURE__ */ n(
34
+ t(
35
+ "instant-apps-filter-list",
36
+ {
37
+ onFilterListReset: "filterListReset",
38
+ onFilterUpdate: "filterUpdate"
39
+ }
40
+ )
41
+ ), u = /* @__PURE__ */ n(
42
+ t(
43
+ "instant-apps-header",
44
+ {
45
+ onInfoIsOpenChanged: "infoIsOpenChanged"
46
+ }
47
+ )
48
+ ), m = /* @__PURE__ */ n(
49
+ t(
50
+ "instant-apps-interactive-legend",
51
+ {}
52
+ )
53
+ ), A = /* @__PURE__ */ n(
54
+ t(
55
+ "instant-apps-interactive-legend-classic",
56
+ {}
57
+ )
58
+ ), L = /* @__PURE__ */ n(
59
+ t(
60
+ "instant-apps-interactive-legend-count",
61
+ {}
62
+ )
63
+ ), v = /* @__PURE__ */ n(
64
+ t(
65
+ "instant-apps-interactive-legend-group-legend-element",
66
+ {}
67
+ )
68
+ ), h = /* @__PURE__ */ n(
69
+ t(
70
+ "instant-apps-interactive-legend-group-legend-element-caption",
71
+ {
72
+ onGroupLayerCaptionElementExpandUpdated: "groupLayerCaptionElementExpandUpdated"
73
+ }
74
+ )
75
+ ), C = /* @__PURE__ */ n(
76
+ t(
77
+ "instant-apps-interactive-legend-layer-element",
78
+ {}
79
+ )
80
+ ), E = /* @__PURE__ */ n(
81
+ t(
82
+ "instant-apps-interactive-legend-layer-element-caption",
83
+ {
84
+ onLayerCaptionElementExpandUpdated: "layerCaptionElementExpandUpdated"
85
+ }
86
+ )
87
+ ), U = /* @__PURE__ */ n(
88
+ t(
89
+ "instant-apps-interactive-legend-legend-element",
90
+ {}
91
+ )
92
+ ), S = /* @__PURE__ */ n(
93
+ t(
94
+ "instant-apps-interactive-legend-legend-element-caption",
95
+ {
96
+ onLegendLayerExpandUpdated: "legendLayerExpandUpdated",
97
+ onShowAllSelected: "showAllSelected"
98
+ }
99
+ )
100
+ ), x = /* @__PURE__ */ n(
101
+ t(
102
+ "instant-apps-interactive-legend-relationship",
103
+ {}
104
+ )
105
+ ), y = /* @__PURE__ */ n(
106
+ t(
107
+ "instant-apps-keyboard-shortcuts",
108
+ {}
109
+ )
110
+ ), f = /* @__PURE__ */ n(
111
+ t(
112
+ "instant-apps-landing-page",
113
+ {
114
+ onLandingPageClose: "landingPageClose",
115
+ onLandingPageOpen: "landingPageOpen"
116
+ }
117
+ )
118
+ ), O = /* @__PURE__ */ n(
119
+ t(
120
+ "instant-apps-language-switcher",
121
+ {
122
+ onSelectedLanguageUpdated: "selectedLanguageUpdated"
123
+ }
124
+ )
125
+ ), P = /* @__PURE__ */ n(
126
+ t(
127
+ "instant-apps-language-translator",
128
+ {
129
+ onTranslatorDataUpdated: "translatorDataUpdated"
130
+ }
131
+ )
132
+ ), w = /* @__PURE__ */ n(
133
+ t(
134
+ "instant-apps-ckeditor-wrapper",
135
+ {
136
+ onDataChanged: "dataChanged",
137
+ onIsFocused: "isFocused"
138
+ }
139
+ )
140
+ ), F = /* @__PURE__ */ n(
141
+ t(
142
+ "instant-apps-language-translator-item",
143
+ {
144
+ onTranslatorItemDataUpdated: "translatorItemDataUpdated"
145
+ }
146
+ )
147
+ ), T = /* @__PURE__ */ n(
148
+ t(
149
+ "instant-apps-language-translator-search",
150
+ {
151
+ onSuggestionSelected: "suggestionSelected"
152
+ }
153
+ )
154
+ ), b = /* @__PURE__ */ n(
155
+ t(
156
+ "instant-apps-measurement",
157
+ {
158
+ onMeasureActive: "measureActive"
159
+ }
160
+ )
161
+ ), R = /* @__PURE__ */ n(
162
+ t(
163
+ "instant-apps-measurement-tool",
164
+ {}
165
+ )
166
+ ), D = /* @__PURE__ */ n(
167
+ t(
168
+ "instant-apps-popover",
169
+ {}
170
+ )
171
+ ), k = /* @__PURE__ */ n(
172
+ t(
173
+ "instant-apps-popovers",
174
+ {}
175
+ )
176
+ ), G = /* @__PURE__ */ n(
177
+ t(
178
+ "instant-apps-scoreboard",
179
+ {
180
+ onScoreboardItemsUpdated: "scoreboardItemsUpdated"
181
+ }
182
+ )
183
+ ), W = /* @__PURE__ */ n(
184
+ t(
185
+ "instant-apps-sign-in",
186
+ {}
187
+ )
188
+ ), M = /* @__PURE__ */ n(
189
+ t(
190
+ "instant-apps-social-share",
191
+ {}
192
+ )
193
+ ), H = /* @__PURE__ */ n(
194
+ t(
195
+ "instant-apps-splash",
196
+ {
197
+ onSplashClose: "splashClose"
198
+ }
199
+ )
200
+ ), K = /* @__PURE__ */ n(
201
+ t(
202
+ "instant-apps-time-filter",
203
+ {}
204
+ )
205
+ );
206
+ export {
207
+ i as InstantAppsAppGuide,
208
+ w as InstantAppsCkeditorWrapper,
209
+ d as InstantAppsControlPanel,
210
+ c as InstantAppsCreate,
211
+ l as InstantAppsExport,
212
+ g as InstantAppsExportViews,
213
+ I as InstantAppsFilterList,
214
+ u as InstantAppsHeader,
215
+ m as InstantAppsInteractiveLegend,
216
+ A as InstantAppsInteractiveLegendClassic,
217
+ L as InstantAppsInteractiveLegendCount,
218
+ v as InstantAppsInteractiveLegendGroupLegendElement,
219
+ h as InstantAppsInteractiveLegendGroupLegendElementCaption,
220
+ C as InstantAppsInteractiveLegendLayerElement,
221
+ E as InstantAppsInteractiveLegendLayerElementCaption,
222
+ U as InstantAppsInteractiveLegendLegendElement,
223
+ S as InstantAppsInteractiveLegendLegendElementCaption,
224
+ x as InstantAppsInteractiveLegendRelationship,
225
+ y as InstantAppsKeyboardShortcuts,
226
+ f as InstantAppsLandingPage,
227
+ O as InstantAppsLanguageSwitcher,
228
+ P as InstantAppsLanguageTranslator,
229
+ F as InstantAppsLanguageTranslatorItem,
230
+ T as InstantAppsLanguageTranslatorSearch,
231
+ b as InstantAppsMeasurement,
232
+ R as InstantAppsMeasurementTool,
233
+ D as InstantAppsPopover,
234
+ k as InstantAppsPopovers,
235
+ G as InstantAppsScoreboard,
236
+ W as InstantAppsSignIn,
237
+ M as InstantAppsSocialShare,
238
+ H as InstantAppsSplash,
239
+ K as InstantAppsTimeFilter
240
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/instant-apps-components-react",
3
- "version": "4.34.0-next.9",
3
+ "version": "4.34.0-next.91",
4
4
  "description": "A set of React components that wrap Instant Apps components",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -12,11 +12,16 @@
12
12
  ],
13
13
  "license": "SEE LICENSE IN LICENSE.md",
14
14
  "dependencies": {
15
- "@arcgis/instant-apps-components": "4.34.0-next.9",
16
- "@ckeditor/ckeditor5-build-classic": "^39.0.1"
15
+ "@arcgis/instant-apps-components": "4.34.0-next.91",
16
+ "@arcgis/lumina": "4.34.0-next.91",
17
+ "@arcgis/map-components": "4.34.0-next.91",
18
+ "@ckeditor/ckeditor5-build-classic": "^39.0.1",
19
+ "@lit/react": "^1.0.7",
20
+ "lit": "^3.3.0",
21
+ "tslib": "^2.8.1"
17
22
  },
18
23
  "peerDependencies": {
19
- "@arcgis/core": ">=4.34.0-next <4.35",
24
+ "@arcgis/core": ">=4.34.0-next.43 <4.35",
20
25
  "react": ">=18.0.0 <19.0.0",
21
26
  "react-dom": ">=18.0.0 <19.0.0"
22
27
  }
@@ -1,37 +0,0 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- /* auto-generated react proxies */
4
- import { createReactComponent } from './react-component-lib';
5
- export const InstantAppsAppGuide = /*@__PURE__*/ createReactComponent('instant-apps-app-guide');
6
- export const InstantAppsCkeditorWrapper = /*@__PURE__*/ createReactComponent('instant-apps-ckeditor-wrapper');
7
- export const InstantAppsControlPanel = /*@__PURE__*/ createReactComponent('instant-apps-control-panel');
8
- export const InstantAppsCreate = /*@__PURE__*/ createReactComponent('instant-apps-create');
9
- export const InstantAppsExport = /*@__PURE__*/ createReactComponent('instant-apps-export');
10
- export const InstantAppsExportViews = /*@__PURE__*/ createReactComponent('instant-apps-export-views');
11
- export const InstantAppsFilterList = /*@__PURE__*/ createReactComponent('instant-apps-filter-list');
12
- export const InstantAppsHeader = /*@__PURE__*/ createReactComponent('instant-apps-header');
13
- export const InstantAppsInteractiveLegend = /*@__PURE__*/ createReactComponent('instant-apps-interactive-legend');
14
- export const InstantAppsInteractiveLegendClassic = /*@__PURE__*/ createReactComponent('instant-apps-interactive-legend-classic');
15
- export const InstantAppsInteractiveLegendCount = /*@__PURE__*/ createReactComponent('instant-apps-interactive-legend-count');
16
- export const InstantAppsInteractiveLegendGroupLegendElement = /*@__PURE__*/ createReactComponent('instant-apps-interactive-legend-group-legend-element');
17
- export const InstantAppsInteractiveLegendGroupLegendElementCaption = /*@__PURE__*/ createReactComponent('instant-apps-interactive-legend-group-legend-element-caption');
18
- export const InstantAppsInteractiveLegendLayerElement = /*@__PURE__*/ createReactComponent('instant-apps-interactive-legend-layer-element');
19
- export const InstantAppsInteractiveLegendLayerElementCaption = /*@__PURE__*/ createReactComponent('instant-apps-interactive-legend-layer-element-caption');
20
- export const InstantAppsInteractiveLegendLegendElement = /*@__PURE__*/ createReactComponent('instant-apps-interactive-legend-legend-element');
21
- export const InstantAppsInteractiveLegendLegendElementCaption = /*@__PURE__*/ createReactComponent('instant-apps-interactive-legend-legend-element-caption');
22
- export const InstantAppsInteractiveLegendRelationship = /*@__PURE__*/ createReactComponent('instant-apps-interactive-legend-relationship');
23
- export const InstantAppsKeyboardShortcuts = /*@__PURE__*/ createReactComponent('instant-apps-keyboard-shortcuts');
24
- export const InstantAppsLandingPage = /*@__PURE__*/ createReactComponent('instant-apps-landing-page');
25
- export const InstantAppsLanguageSwitcher = /*@__PURE__*/ createReactComponent('instant-apps-language-switcher');
26
- export const InstantAppsLanguageTranslator = /*@__PURE__*/ createReactComponent('instant-apps-language-translator');
27
- export const InstantAppsLanguageTranslatorItem = /*@__PURE__*/ createReactComponent('instant-apps-language-translator-item');
28
- export const InstantAppsLanguageTranslatorSearch = /*@__PURE__*/ createReactComponent('instant-apps-language-translator-search');
29
- export const InstantAppsMeasurement = /*@__PURE__*/ createReactComponent('instant-apps-measurement');
30
- export const InstantAppsMeasurementTool = /*@__PURE__*/ createReactComponent('instant-apps-measurement-tool');
31
- export const InstantAppsPopover = /*@__PURE__*/ createReactComponent('instant-apps-popover');
32
- export const InstantAppsPopovers = /*@__PURE__*/ createReactComponent('instant-apps-popovers');
33
- export const InstantAppsScoreboard = /*@__PURE__*/ createReactComponent('instant-apps-scoreboard');
34
- export const InstantAppsSignIn = /*@__PURE__*/ createReactComponent('instant-apps-sign-in');
35
- export const InstantAppsSocialShare = /*@__PURE__*/ createReactComponent('instant-apps-social-share');
36
- export const InstantAppsSplash = /*@__PURE__*/ createReactComponent('instant-apps-splash');
37
- export const InstantAppsTimeFilter = /*@__PURE__*/ createReactComponent('instant-apps-time-filter');
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export interface HTMLStencilElement extends HTMLElement {
3
- componentOnReady(): Promise<this>;
4
- }
5
- interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
6
- forwardedRef: React.RefObject<ElementType>;
7
- ref?: React.Ref<any>;
8
- }
9
- export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType>, manipulatePropsFunction?: (originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes, defineCustomElement?: () => void) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
10
- export {};
@@ -1,67 +0,0 @@
1
- import React, { createElement } from 'react';
2
- import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
3
- export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => {
4
- if (defineCustomElement !== undefined) {
5
- defineCustomElement();
6
- }
7
- const displayName = dashToPascalCase(tagName);
8
- const ReactComponent = class extends React.Component {
9
- constructor(props) {
10
- super(props);
11
- this.setComponentElRef = (element) => {
12
- this.componentEl = element;
13
- };
14
- }
15
- componentDidMount() {
16
- this.componentDidUpdate(this.props);
17
- }
18
- componentDidUpdate(prevProps) {
19
- attachProps(this.componentEl, this.props, prevProps);
20
- }
21
- render() {
22
- const { children, forwardedRef, style, className, ref, ...cProps } = this.props;
23
- let propsToPass = Object.keys(cProps).reduce((acc, name) => {
24
- const value = cProps[name];
25
- if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
26
- const eventName = name.substring(2).toLowerCase();
27
- if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
28
- acc[name] = value;
29
- }
30
- }
31
- else {
32
- // we should only render strings, booleans, and numbers as attrs in html.
33
- // objects, functions, arrays etc get synced via properties on mount.
34
- const type = typeof value;
35
- if (type === 'string' || type === 'boolean' || type === 'number') {
36
- acc[camelToDashCase(name)] = value;
37
- }
38
- }
39
- return acc;
40
- }, {});
41
- if (manipulatePropsFunction) {
42
- propsToPass = manipulatePropsFunction(this.props, propsToPass);
43
- }
44
- const newProps = {
45
- ...propsToPass,
46
- ref: mergeRefs(forwardedRef, this.setComponentElRef),
47
- style,
48
- };
49
- /**
50
- * We use createElement here instead of
51
- * React.createElement to work around a
52
- * bug in Vite (https://github.com/vitejs/vite/issues/6104).
53
- * React.createElement causes all elements to be rendered
54
- * as <tagname> instead of the actual Web Component.
55
- */
56
- return createElement(tagName, newProps, children);
57
- }
58
- static get displayName() {
59
- return displayName;
60
- }
61
- };
62
- // If context was passed to createReactComponent then conditionally add it to the Component Class
63
- if (ReactComponentContext) {
64
- ReactComponent.contextType = ReactComponentContext;
65
- }
66
- return createForwardRef(ReactComponent, displayName);
67
- };
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { OverlayEventDetail } from './interfaces';
3
- import { StencilReactForwardedRef } from './utils';
4
- interface OverlayElement extends HTMLElement {
5
- present: () => Promise<void>;
6
- dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
7
- }
8
- export interface ReactOverlayProps {
9
- children?: React.ReactNode;
10
- isOpen: boolean;
11
- onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
12
- onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
13
- onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
14
- onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
15
- }
16
- export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(tagName: string, controller: {
17
- create: (options: any) => Promise<OverlayType>;
18
- }, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
19
- forwardedRef?: StencilReactForwardedRef<OverlayType>;
20
- }> & React.RefAttributes<OverlayType>>;
21
- export {};
@@ -1,95 +0,0 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom';
3
- import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
4
- export const createOverlayComponent = (tagName, controller, customElement) => {
5
- defineCustomElement(tagName, customElement);
6
- const displayName = dashToPascalCase(tagName);
7
- const didDismissEventName = `on${displayName}DidDismiss`;
8
- const didPresentEventName = `on${displayName}DidPresent`;
9
- const willDismissEventName = `on${displayName}WillDismiss`;
10
- const willPresentEventName = `on${displayName}WillPresent`;
11
- let isDismissing = false;
12
- class Overlay extends React.Component {
13
- constructor(props) {
14
- super(props);
15
- if (typeof document !== 'undefined') {
16
- this.el = document.createElement('div');
17
- }
18
- this.handleDismiss = this.handleDismiss.bind(this);
19
- }
20
- static get displayName() {
21
- return displayName;
22
- }
23
- componentDidMount() {
24
- if (this.props.isOpen) {
25
- this.present();
26
- }
27
- }
28
- componentWillUnmount() {
29
- if (this.overlay) {
30
- this.overlay.dismiss();
31
- }
32
- }
33
- handleDismiss(event) {
34
- if (this.props.onDidDismiss) {
35
- this.props.onDidDismiss(event);
36
- }
37
- setRef(this.props.forwardedRef, null);
38
- }
39
- shouldComponentUpdate(nextProps) {
40
- // Check if the overlay component is about to dismiss
41
- if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
42
- isDismissing = true;
43
- }
44
- return true;
45
- }
46
- async componentDidUpdate(prevProps) {
47
- if (this.overlay) {
48
- attachProps(this.overlay, this.props, prevProps);
49
- }
50
- if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
51
- this.present(prevProps);
52
- }
53
- if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
54
- await this.overlay.dismiss();
55
- isDismissing = false;
56
- /**
57
- * Now that the overlay is dismissed
58
- * we need to render again so that any
59
- * inner components will be unmounted
60
- */
61
- this.forceUpdate();
62
- }
63
- }
64
- async present(prevProps) {
65
- const { children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent, ...cProps } = this.props;
66
- const elementProps = {
67
- ...cProps,
68
- ref: this.props.forwardedRef,
69
- [didDismissEventName]: this.handleDismiss,
70
- [didPresentEventName]: (e) => this.props.onDidPresent && this.props.onDidPresent(e),
71
- [willDismissEventName]: (e) => this.props.onWillDismiss && this.props.onWillDismiss(e),
72
- [willPresentEventName]: (e) => this.props.onWillPresent && this.props.onWillPresent(e),
73
- };
74
- this.overlay = await controller.create({
75
- ...elementProps,
76
- component: this.el,
77
- componentProps: {},
78
- });
79
- setRef(this.props.forwardedRef, this.overlay);
80
- attachProps(this.overlay, elementProps, prevProps);
81
- await this.overlay.present();
82
- }
83
- render() {
84
- /**
85
- * Continue to render the component even when
86
- * overlay is dismissing otherwise component
87
- * will be hidden before animation is done.
88
- */
89
- return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
90
- }
91
- }
92
- return React.forwardRef((props, ref) => {
93
- return React.createElement(Overlay, { ...props, forwardedRef: ref });
94
- });
95
- };
@@ -1,2 +0,0 @@
1
- export { createReactComponent } from './createComponent';
2
- export { createOverlayComponent } from './createOverlayComponent';
@@ -1,2 +0,0 @@
1
- export { createReactComponent } from './createComponent';
2
- export { createOverlayComponent } from './createOverlayComponent';
@@ -1,29 +0,0 @@
1
- export interface EventEmitter<T = any> {
2
- emit: (data?: T) => CustomEvent<T>;
3
- }
4
- export interface StyleReactProps {
5
- class?: string;
6
- className?: string;
7
- style?: {
8
- [key: string]: any;
9
- };
10
- }
11
- export interface OverlayEventDetail<T = any> {
12
- data?: T;
13
- role?: string;
14
- }
15
- export interface OverlayInterface {
16
- el: HTMLElement;
17
- animated: boolean;
18
- keyboardClose: boolean;
19
- overlayIndex: number;
20
- presented: boolean;
21
- enterAnimation?: any;
22
- leaveAnimation?: any;
23
- didPresent: EventEmitter<void>;
24
- willPresent: EventEmitter<void>;
25
- willDismiss: EventEmitter<OverlayEventDetail>;
26
- didDismiss: EventEmitter<OverlayEventDetail>;
27
- present(): Promise<void>;
28
- dismiss(data?: any, role?: string): Promise<boolean>;
29
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
2
- export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
3
- /**
4
- * Transforms a React event name to a browser event name.
5
- */
6
- export declare const transformReactEventName: (eventNameSuffix: string) => string;
7
- /**
8
- * Checks if an event is supported in the current execution environment.
9
- * @license Modernizr 3.0.0pre (Custom Build) | MIT
10
- */
11
- export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
12
- export declare const syncEvent: (node: Element & {
13
- __events?: {
14
- [key: string]: ((e: Event) => any) | undefined;
15
- };
16
- }, eventName: string, newEventHandler?: (e: Event) => any) => void;
@@ -1,107 +0,0 @@
1
- import { camelToDashCase } from './case';
2
- export const attachProps = (node, newProps, oldProps = {}) => {
3
- // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
4
- if (node instanceof Element) {
5
- // add any classes in className to the class list
6
- const className = getClassName(node.classList, newProps, oldProps);
7
- if (className !== '') {
8
- node.className = className;
9
- }
10
- Object.keys(newProps).forEach((name) => {
11
- if (name === 'children' ||
12
- name === 'style' ||
13
- name === 'ref' ||
14
- name === 'class' ||
15
- name === 'className' ||
16
- name === 'forwardedRef') {
17
- return;
18
- }
19
- if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
20
- const eventName = name.substring(2);
21
- const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
22
- if (!isCoveredByReact(eventNameLc)) {
23
- syncEvent(node, eventNameLc, newProps[name]);
24
- }
25
- }
26
- else {
27
- node[name] = newProps[name];
28
- const propType = typeof newProps[name];
29
- if (propType === 'string') {
30
- node.setAttribute(camelToDashCase(name), newProps[name]);
31
- }
32
- }
33
- });
34
- }
35
- };
36
- export const getClassName = (classList, newProps, oldProps) => {
37
- const newClassProp = newProps.className || newProps.class;
38
- const oldClassProp = oldProps.className || oldProps.class;
39
- // map the classes to Maps for performance
40
- const currentClasses = arrayToMap(classList);
41
- const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
42
- const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
43
- const finalClassNames = [];
44
- // loop through each of the current classes on the component
45
- // to see if it should be a part of the classNames added
46
- currentClasses.forEach((currentClass) => {
47
- if (incomingPropClasses.has(currentClass)) {
48
- // add it as its already included in classnames coming in from newProps
49
- finalClassNames.push(currentClass);
50
- incomingPropClasses.delete(currentClass);
51
- }
52
- else if (!oldPropClasses.has(currentClass)) {
53
- // add it as it has NOT been removed by user
54
- finalClassNames.push(currentClass);
55
- }
56
- });
57
- incomingPropClasses.forEach((s) => finalClassNames.push(s));
58
- return finalClassNames.join(' ');
59
- };
60
- /**
61
- * Transforms a React event name to a browser event name.
62
- */
63
- export const transformReactEventName = (eventNameSuffix) => {
64
- switch (eventNameSuffix) {
65
- case 'doubleclick':
66
- return 'dblclick';
67
- }
68
- return eventNameSuffix;
69
- };
70
- /**
71
- * Checks if an event is supported in the current execution environment.
72
- * @license Modernizr 3.0.0pre (Custom Build) | MIT
73
- */
74
- export const isCoveredByReact = (eventNameSuffix) => {
75
- if (typeof document === 'undefined') {
76
- return true;
77
- }
78
- else {
79
- const eventName = 'on' + transformReactEventName(eventNameSuffix);
80
- let isSupported = eventName in document;
81
- if (!isSupported) {
82
- const element = document.createElement('div');
83
- element.setAttribute(eventName, 'return;');
84
- isSupported = typeof element[eventName] === 'function';
85
- }
86
- return isSupported;
87
- }
88
- };
89
- export const syncEvent = (node, eventName, newEventHandler) => {
90
- const eventStore = node.__events || (node.__events = {});
91
- const oldEventHandler = eventStore[eventName];
92
- // Remove old listener so they don't double up.
93
- if (oldEventHandler) {
94
- node.removeEventListener(eventName, oldEventHandler);
95
- }
96
- // Bind new listener.
97
- node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
98
- if (newEventHandler) {
99
- newEventHandler.call(this, e);
100
- }
101
- }));
102
- };
103
- const arrayToMap = (arr) => {
104
- const map = new Map();
105
- arr.forEach((s) => map.set(s, s));
106
- return map;
107
- };
@@ -1,2 +0,0 @@
1
- export declare const dashToPascalCase: (str: string) => string;
2
- export declare const camelToDashCase: (str: string) => string;
@@ -1,6 +0,0 @@
1
- export const dashToPascalCase = (str) => str
2
- .toLowerCase()
3
- .split('-')
4
- .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
5
- .join('');
6
- export const camelToDashCase = (str) => str.replace(/([A-Z])/g, (m) => `-${m[0].toLowerCase()}`);
@@ -1,2 +0,0 @@
1
- export declare const isDevMode: () => boolean;
2
- export declare const deprecationWarning: (key: string, message: string) => void;
@@ -1,12 +0,0 @@
1
- export const isDevMode = () => {
2
- return process && process.env && process.env.NODE_ENV === 'development';
3
- };
4
- const warnings = {};
5
- export const deprecationWarning = (key, message) => {
6
- if (isDevMode()) {
7
- if (!warnings[key]) {
8
- console.warn(message);
9
- warnings[key] = true;
10
- }
11
- }
12
- };
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { StyleReactProps } from '../interfaces';
3
- export type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
4
- export type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;
5
- export declare const setRef: (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => void;
6
- export declare const mergeRefs: (...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]) => React.RefCallback<any>;
7
- export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
8
- export declare const defineCustomElement: (tagName: string, customElement: any) => void;
9
- export * from './attachProps';
10
- export * from './case';
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- export const setRef = (ref, value) => {
3
- if (typeof ref === 'function') {
4
- ref(value);
5
- }
6
- else if (ref != null) {
7
- // Cast as a MutableRef so we can assign current
8
- ref.current = value;
9
- }
10
- };
11
- export const mergeRefs = (...refs) => {
12
- return (value) => {
13
- refs.forEach((ref) => {
14
- setRef(ref, value);
15
- });
16
- };
17
- };
18
- export const createForwardRef = (ReactComponent, displayName) => {
19
- const forwardRef = (props, ref) => {
20
- return React.createElement(ReactComponent, { ...props, forwardedRef: ref });
21
- };
22
- forwardRef.displayName = displayName;
23
- return React.forwardRef(forwardRef);
24
- };
25
- export const defineCustomElement = (tagName, customElement) => {
26
- if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
27
- customElements.define(tagName, customElement);
28
- }
29
- };
30
- export * from './attachProps';
31
- export * from './case';