From 1ed22750a8a3f501f1de986361e86f0559180657 Mon Sep 17 00:00:00 2001 From: Extended Component Library Team Date: Mon, 6 Nov 2023 09:39:47 -0800 Subject: [PATCH] fix: include Routes components in generated React module PiperOrigin-RevId: 579871094 --- build/make_react.js | 2 -- src/react/index.ts | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/build/make_react.js b/build/make_react.js index ff98250..f848336 100644 --- a/build/make_react.js +++ b/build/make_react.js @@ -77,8 +77,6 @@ import {RequestErrorEvent} from '../base/events.js'; `; // Import new event types here (TS compiler will complain otherwise). for (const {name: className, tagName, events, path, members} of components) { - if (className.startsWith('Route')) continue; - const classAlias = className + 'WC'; const eventMapping = printEventMapping(events ?? []); content += ` diff --git a/src/react/index.ts b/src/react/index.ts index 468b64b..234230e 100644 --- a/src/react/index.ts +++ b/src/react/index.ts @@ -150,6 +150,44 @@ export const PlaceReviews = createComponent({ react: React, }); +import {RouteDataProvider as RouteDataProviderWC} from '../route_building_blocks/route_data_provider/route_data_provider.js'; + +export const RouteDataProvider = createComponent({ + tagName: 'gmpx-route-data-provider', + elementClass: RouteDataProviderWC, + react: React, + events: { + 'onRequestError': 'gmpx-requesterror' as EventName, + }, +}); + +import {RouteMarker as RouteMarkerWC} from '../route_building_blocks/route_marker/route_marker.js'; + +export const RouteMarker = createComponent({ + tagName: 'gmpx-route-marker', + elementClass: RouteMarkerWC, + react: React, +}); + +import {RouteOverview as RouteOverviewWC} from '../route_overview/route_overview.js'; + +export const RouteOverview = createComponent({ + tagName: 'gmpx-route-overview', + elementClass: RouteOverviewWC, + react: React, + events: { + 'onRequestError': 'gmpx-requesterror' as EventName, + }, +}); + +import {RoutePolyline as RoutePolylineWC} from '../route_building_blocks/route_polyline/route_polyline.js'; + +export const RoutePolyline = createComponent({ + tagName: 'gmpx-route-polyline', + elementClass: RoutePolylineWC, + react: React, +}); + import {SplitLayout as SplitLayoutWC} from '../split_layout/split_layout.js'; export const SplitLayout = createComponent({