diff --git a/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-1.png b/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-1.png index 2c03cee67..384547af2 100644 Binary files a/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-1.png and b/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-1.png differ diff --git a/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-2.png b/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-2.png index 10c4d8640..4f5a84722 100644 Binary files a/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-2.png and b/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-2.png differ diff --git a/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-3.png b/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-3.png index b6b83a9fd..2b57508b4 100644 Binary files a/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-3.png and b/e2e-tests/__screenshots__/darwin/add-element.spec.ts/can-add-a-Footer-component-3.png differ diff --git a/e2e-tests/__screenshots__/darwin/rearrange-elements.spec.ts/can-rearrange-elements-in-tree-1.png b/e2e-tests/__screenshots__/darwin/rearrange-elements.spec.ts/can-rearrange-elements-in-tree-1.png index 840b34c77..c53be7873 100644 Binary files a/e2e-tests/__screenshots__/darwin/rearrange-elements.spec.ts/can-rearrange-elements-in-tree-1.png and b/e2e-tests/__screenshots__/darwin/rearrange-elements.spec.ts/can-rearrange-elements-in-tree-1.png differ diff --git a/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-1.png b/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-1.png index 1434eb785..32c20d7af 100644 Binary files a/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-1.png and b/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-1.png differ diff --git a/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-2.png b/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-2.png index 94246181a..02dfc86d0 100644 Binary files a/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-2.png and b/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-2.png differ diff --git a/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-3.png b/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-3.png index 6c9c48895..32c20d7af 100644 Binary files a/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-3.png and b/e2e-tests/__screenshots__/darwin/viewport-menu.spec.ts/can-set-and-reset-Viewport-3.png differ diff --git a/e2e-tests/localData/cog-internal-feature-static-file-generation-BasicPage__en__cfcd208495d565ef66e7dff9f98764da.json b/e2e-tests/localData/cog-internal-feature-static-file-generation-BasicPage__en__cfcd208495d565ef66e7dff9f98764da.json index 96fe7c1e8..75bde11f6 100644 --- a/e2e-tests/localData/cog-internal-feature-static-file-generation-BasicPage__en__cfcd208495d565ef66e7dff9f98764da.json +++ b/e2e-tests/localData/cog-internal-feature-static-file-generation-BasicPage__en__cfcd208495d565ef66e7dff9f98764da.json @@ -1,16 +1,16 @@ { - "__": { - "name": "BasicPage", - "staticPage": {}, - "templateType": "JS" - }, - "businessId": 3350634, - "key": "0:BasicPage:knowledgeGraph:0:en", - "locale": "en", - "meta": { - "locale": "en" - }, - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "" -} + "__": { + "name": "BasicPage", + "staticPage": {}, + "templateType": "JS" + }, + "businessId": 3350634, + "key": "0:BasicPage:knowledgeGraph:0:en", + "locale": "en", + "meta": { + "locale": "en" + }, + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "" +} \ No newline at end of file diff --git a/e2e-tests/localData/cog-internal-feature-static-file-generation-ErrorComponentPreviews__en__cfcd208495d565ef66e7dff9f98764da.json b/e2e-tests/localData/cog-internal-feature-static-file-generation-ErrorComponentPreviews__en__cfcd208495d565ef66e7dff9f98764da.json index 184f4c953..00667cac9 100644 --- a/e2e-tests/localData/cog-internal-feature-static-file-generation-ErrorComponentPreviews__en__cfcd208495d565ef66e7dff9f98764da.json +++ b/e2e-tests/localData/cog-internal-feature-static-file-generation-ErrorComponentPreviews__en__cfcd208495d565ef66e7dff9f98764da.json @@ -1,16 +1,16 @@ { - "__": { - "name": "ErrorComponentPreviews", - "staticPage": {}, - "templateType": "JS" - }, - "businessId": 3350634, - "key": "0:ErrorComponentPreviews:knowledgeGraph:0:en", - "locale": "en", - "meta": { - "locale": "en" - }, - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "" -} + "__": { + "name": "ErrorComponentPreviews", + "staticPage": {}, + "templateType": "JS" + }, + "businessId": 3350634, + "key": "0:ErrorComponentPreviews:knowledgeGraph:0:en", + "locale": "en", + "meta": { + "locale": "en" + }, + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "" +} \ No newline at end of file diff --git a/e2e-tests/localData/cog-internal-feature-static-file-generation-ErrorPage__en__cfcd208495d565ef66e7dff9f98764da.json b/e2e-tests/localData/cog-internal-feature-static-file-generation-ErrorPage__en__cfcd208495d565ef66e7dff9f98764da.json new file mode 100644 index 000000000..0230c5376 --- /dev/null +++ b/e2e-tests/localData/cog-internal-feature-static-file-generation-ErrorPage__en__cfcd208495d565ef66e7dff9f98764da.json @@ -0,0 +1,16 @@ +{ + "__": { + "name": "ErrorPage", + "staticPage": {}, + "templateType": "JS" + }, + "businessId": 3350634, + "key": "0:ErrorPage:knowledgeGraph:0:en", + "locale": "en", + "meta": { + "locale": "en" + }, + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "" +} \ No newline at end of file diff --git a/e2e-tests/localData/cog-internal-feature-static-file-generation-NewStaticPage__en__cfcd208495d565ef66e7dff9f98764da.json b/e2e-tests/localData/cog-internal-feature-static-file-generation-NewStaticPage__en__cfcd208495d565ef66e7dff9f98764da.json deleted file mode 100644 index a9d0d1dbc..000000000 --- a/e2e-tests/localData/cog-internal-feature-static-file-generation-NewStaticPage__en__cfcd208495d565ef66e7dff9f98764da.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "__": { - "name": "NewStaticPage", - "staticPage": {}, - "templateType": "JS" - }, - "businessId": 3350634, - "key": "0:NewStaticPage:knowledgeGraph:0:en", - "locale": "en", - "meta": { - "locale": "en" - }, - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "" -} diff --git a/e2e-tests/localData/mapping.json b/e2e-tests/localData/mapping.json index 81bb9a5e1..4014430a7 100644 --- a/e2e-tests/localData/mapping.json +++ b/e2e-tests/localData/mapping.json @@ -1,23 +1,23 @@ { - "BasicPage": [ - "cog-internal-feature-static-file-generation-BasicPage__en__cfcd208495d565ef66e7dff9f98764da.json" - ], - "ErrorComponentPreviews": [ - "cog-internal-feature-static-file-generation-ErrorComponentPreviews__en__cfcd208495d565ef66e7dff9f98764da.json" - ], - "ErrorPage": [ - "cog-internal-feature-static-file-generation-ErrorPage__en__cfcd208495d565ef66e7dff9f98764da.json" - ], - "LocationPage": [ - "studio-stream-id-LocationPage__en__b5c72eb6622ba376c857dbedac25989b.json", - "studio-stream-id-LocationPage__en__c436bc541570239fdbb3c86a549f7a71.json", - "studio-stream-id-LocationPage__en__138daa2e17fc5803f9d87d45899b6bd1.json", - "studio-stream-id-LocationPage__en__74f6cc7a9108951c20122cd3dabb7eb5.json", - "studio-stream-id-LocationPage__en__3a148c2b8fc08ea238566ecbca52ed91.json", - "studio-stream-id-LocationPage__en__7d5f646cf2f84c4ce9ef3a0f92afe207.json", - "studio-stream-id-LocationPage__en__ab9a660c88afbd8dafb14c8c8b281274.json", - "studio-stream-id-LocationPage__en__a09d94986018c82320dfe5e138ea88ef.json", - "studio-stream-id-LocationPage__en__63332cafcabf752f4ecfa57bb7f83e42.json", - "studio-stream-id-LocationPage__en__8f3df878733e5e0969823b81e3bf497f.json" - ] -} + "BasicPage": [ + "cog-internal-feature-static-file-generation-BasicPage__en__cfcd208495d565ef66e7dff9f98764da.json" + ], + "ErrorComponentPreviews": [ + "cog-internal-feature-static-file-generation-ErrorComponentPreviews__en__cfcd208495d565ef66e7dff9f98764da.json" + ], + "ErrorPage": [ + "cog-internal-feature-static-file-generation-ErrorPage__en__cfcd208495d565ef66e7dff9f98764da.json" + ], + "LocationPage": [ + "studio-stream-id-LocationPage__en__b5c72eb6622ba376c857dbedac25989b.json", + "studio-stream-id-LocationPage__en__c436bc541570239fdbb3c86a549f7a71.json", + "studio-stream-id-LocationPage__en__138daa2e17fc5803f9d87d45899b6bd1.json", + "studio-stream-id-LocationPage__en__74f6cc7a9108951c20122cd3dabb7eb5.json", + "studio-stream-id-LocationPage__en__3a148c2b8fc08ea238566ecbca52ed91.json", + "studio-stream-id-LocationPage__en__7d5f646cf2f84c4ce9ef3a0f92afe207.json", + "studio-stream-id-LocationPage__en__ab9a660c88afbd8dafb14c8c8b281274.json", + "studio-stream-id-LocationPage__en__a09d94986018c82320dfe5e138ea88ef.json", + "studio-stream-id-LocationPage__en__63332cafcabf752f4ecfa57bb7f83e42.json", + "studio-stream-id-LocationPage__en__8f3df878733e5e0969823b81e3bf497f.json" + ] +} \ No newline at end of file diff --git a/e2e-tests/localData/studio-stream-id-LocationPage__en__138daa2e17fc5803f9d87d45899b6bd1.json b/e2e-tests/localData/studio-stream-id-LocationPage__en__138daa2e17fc5803f9d87d45899b6bd1.json index 00c711b8d..788861c37 100644 --- a/e2e-tests/localData/studio-stream-id-LocationPage__en__138daa2e17fc5803f9d87d45899b6bd1.json +++ b/e2e-tests/localData/studio-stream-id-LocationPage__en__138daa2e17fc5803f9d87d45899b6bd1.json @@ -1,108 +1,114 @@ { - "__": { - "entityPageSet": {}, - "name": "LocationPage", - "streamId": "studio-stream-id-LocationPage", - "templateType": "JS" - }, - "address": { - "city": "London", - "countryCode": "GB", - "line1": "48 Warwick St.", - "line2": "Office 410", - "localizedCountryName": "United Kingdom", - "localizedRegionName": "City of London", - "postalCode": "W1B 5AW", - "region": "Gt Lon" - }, - "addressHidden": false, - "businessId": 3350634, - "c_features": ["OPEN_NOW"], - "cityCoordinate": { - "latitude": 51.50642013549805, - "longitude": -0.12721000611782074 - }, - "description": "Yext is the global digital knowledge management leader, and our Knowledge Engine puts businesses in control of their digital knowledge.", - "displayCoordinate": { - "latitude": 51.5107139, - "longitude": -0.1377914 - }, - "geocodedCoordinate": { - "latitude": 51.5106898, - "longitude": -0.1378107 - }, - "hours": { - "friday": { - "isClosed": true - }, - "monday": { - "isClosed": true - }, - "saturday": { - "isClosed": true - }, - "sunday": { - "isClosed": true - }, - "thursday": { - "isClosed": true - }, - "tuesday": { - "openIntervals": [ - { - "end": "16:00", - "start": "15:00" - } - ] - }, - "wednesday": { - "isClosed": true - } - }, - "id": "7941089580646240971", - "isoRegionCode": "LND", - "key": "0:LocationPage:knowledgeGraph:18714999:en", - "locale": "en", - "mainPhone": "+442037052290", - "meta": { - "entityType": { - "id": "location", - "uid": 0 - }, - "locale": "en" - }, - "name": "Office Space", - "priceRange": "FOUR", - "ref_categories": [ - { - "id": "668", - "name": "Software Consultant", - "uid": 668 - } - ], - "ref_listings": [], - "ref_reviewsAgg": [], - "routableCoordinate": { - "latitude": 51.51076, - "longitude": -0.13767 - }, - "services": ["Dogs", "Cats", "Sleep"], - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "", - "slug": "office/7941089580646240971", - "timezone": "Europe/London", - "uid": 18714999, - "websiteUrl": { - "preferDisplayUrl": false, - "url": "https://locations.yext.com/gb/gt-lon/london/48-warwick-st-.html" - }, - "yextDisplayCoordinate": { - "latitude": 51.5107139, - "longitude": -0.1377914 - }, - "yextRoutableCoordinate": { - "latitude": 51.51076, - "longitude": -0.13767 - } -} + "__": { + "entityPageSet": {}, + "name": "LocationPage", + "streamId": "studio-stream-id-LocationPage", + "templateType": "JS" + }, + "address": { + "city": "London", + "countryCode": "GB", + "line1": "48 Warwick St.", + "line2": "Office 410", + "localizedCountryName": "United Kingdom", + "localizedRegionName": "City of London", + "postalCode": "W1B 5AW", + "region": "Gt Lon" + }, + "addressHidden": false, + "businessId": 3350634, + "c_features": [ + "OPEN_NOW" + ], + "cityCoordinate": { + "latitude": 51.50642013549805, + "longitude": -0.12721000611782074 + }, + "description": "Yext is the global digital knowledge management leader, and our Knowledge Engine puts businesses in control of their digital knowledge.", + "displayCoordinate": { + "latitude": 51.5107139, + "longitude": -0.1377914 + }, + "geocodedCoordinate": { + "latitude": 51.5106898, + "longitude": -0.1378107 + }, + "hours": { + "friday": { + "isClosed": true + }, + "monday": { + "isClosed": true + }, + "saturday": { + "isClosed": true + }, + "sunday": { + "isClosed": true + }, + "thursday": { + "isClosed": true + }, + "tuesday": { + "openIntervals": [ + { + "end": "16:00", + "start": "15:00" + } + ] + }, + "wednesday": { + "isClosed": true + } + }, + "id": "7941089580646240971", + "isoRegionCode": "LND", + "key": "0:LocationPage:knowledgeGraph:18714999:en", + "locale": "en", + "mainPhone": "+442037052290", + "meta": { + "entityType": { + "id": "location", + "uid": 0 + }, + "locale": "en" + }, + "name": "Office Space", + "priceRange": "FOUR", + "ref_categories": [ + { + "id": "668", + "name": "Software Consultant", + "uid": 668 + } + ], + "ref_listings": [], + "ref_reviewsAgg": [], + "routableCoordinate": { + "latitude": 51.51076, + "longitude": -0.13767 + }, + "services": [ + "Dogs", + "Cats", + "Sleep" + ], + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "", + "slug": "office/7941089580646240971", + "timezone": "Europe/London", + "uid": 18714999, + "websiteUrl": { + "preferDisplayUrl": false, + "url": "https://locations.yext.com/gb/gt-lon/london/48-warwick-st-.html" + }, + "yextDisplayCoordinate": { + "latitude": 51.5107139, + "longitude": -0.1377914 + }, + "yextRoutableCoordinate": { + "latitude": 51.51076, + "longitude": -0.13767 + } +} \ No newline at end of file diff --git a/e2e-tests/localData/studio-stream-id-LocationPage__en__3a148c2b8fc08ea238566ecbca52ed91.json b/e2e-tests/localData/studio-stream-id-LocationPage__en__3a148c2b8fc08ea238566ecbca52ed91.json index 057cfa64f..17d3b7ed2 100644 --- a/e2e-tests/localData/studio-stream-id-LocationPage__en__3a148c2b8fc08ea238566ecbca52ed91.json +++ b/e2e-tests/localData/studio-stream-id-LocationPage__en__3a148c2b8fc08ea238566ecbca52ed91.json @@ -1,107 +1,113 @@ { - "__": { - "entityPageSet": {}, - "name": "LocationPage", - "streamId": "studio-stream-id-LocationPage", - "templateType": "JS" - }, - "address": { - "city": "Chicago", - "countryCode": "US", - "line1": "500 West Madison St.", - "line2": "Suite 2810", - "localizedCountryName": "United States", - "localizedRegionName": "Illinois", - "postalCode": "60661", - "region": "IL" - }, - "addressHidden": false, - "businessId": 3350634, - "c_features": ["BIG_STORE"], - "cityCoordinate": { - "latitude": 41.879535, - "longitude": -87.624333 - }, - "description": "Yext is the global digital knowledge management leader, and our Knowledge Engine puts businesses in control of their digital knowledge.", - "displayCoordinate": { - "latitude": 41.8823062, - "longitude": -87.6403882 - }, - "geocodedCoordinate": { - "latitude": 41.8823062, - "longitude": -87.6403882 - }, - "hours": { - "friday": { - "isClosed": true - }, - "monday": { - "isClosed": true - }, - "saturday": { - "isClosed": true - }, - "sunday": { - "openIntervals": [ - { - "end": "14:00", - "start": "01:00" - } - ] - }, - "thursday": { - "isClosed": true - }, - "tuesday": { - "isClosed": true - }, - "wednesday": { - "isClosed": true - } - }, - "id": "1659277149695818196", - "isoRegionCode": "IL", - "key": "0:LocationPage:knowledgeGraph:18715001:en", - "locale": "en", - "mainPhone": "+12129943900", - "meta": { - "entityType": { - "id": "location", - "uid": 0 - }, - "locale": "en" - }, - "name": "Office Space 2", - "ref_categories": [ - { - "id": "668", - "name": "Software Consultant", - "uid": 668 - } - ], - "ref_listings": [], - "ref_reviewsAgg": [], - "routableCoordinate": { - "latitude": 41.8818647, - "longitude": -87.6404641 - }, - "services": ["Dogs", "Cats", "Sleep"], - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "", - "slug": "office/1659277149695818196", - "timezone": "America/Chicago", - "uid": 18715001, - "websiteUrl": { - "preferDisplayUrl": false, - "url": "https://locations.yext.com/us/il/chicago/500-west-madison-st-.html" - }, - "yextDisplayCoordinate": { - "latitude": 41.8823062, - "longitude": -87.6403882 - }, - "yextRoutableCoordinate": { - "latitude": 41.8818647, - "longitude": -87.6404641 - } -} + "__": { + "entityPageSet": {}, + "name": "LocationPage", + "streamId": "studio-stream-id-LocationPage", + "templateType": "JS" + }, + "address": { + "city": "Chicago", + "countryCode": "US", + "line1": "500 West Madison St.", + "line2": "Suite 2810", + "localizedCountryName": "United States", + "localizedRegionName": "Illinois", + "postalCode": "60661", + "region": "IL" + }, + "addressHidden": false, + "businessId": 3350634, + "c_features": [ + "BIG_STORE" + ], + "cityCoordinate": { + "latitude": 41.879535, + "longitude": -87.624333 + }, + "description": "Yext is the global digital knowledge management leader, and our Knowledge Engine puts businesses in control of their digital knowledge.", + "displayCoordinate": { + "latitude": 41.8823062, + "longitude": -87.6403882 + }, + "geocodedCoordinate": { + "latitude": 41.8823062, + "longitude": -87.6403882 + }, + "hours": { + "friday": { + "isClosed": true + }, + "monday": { + "isClosed": true + }, + "saturday": { + "isClosed": true + }, + "sunday": { + "openIntervals": [ + { + "end": "14:00", + "start": "01:00" + } + ] + }, + "thursday": { + "isClosed": true + }, + "tuesday": { + "isClosed": true + }, + "wednesday": { + "isClosed": true + } + }, + "id": "1659277149695818196", + "isoRegionCode": "IL", + "key": "0:LocationPage:knowledgeGraph:18715001:en", + "locale": "en", + "mainPhone": "+12129943900", + "meta": { + "entityType": { + "id": "location", + "uid": 0 + }, + "locale": "en" + }, + "name": "Office Space 2", + "ref_categories": [ + { + "id": "668", + "name": "Software Consultant", + "uid": 668 + } + ], + "ref_listings": [], + "ref_reviewsAgg": [], + "routableCoordinate": { + "latitude": 41.8818647, + "longitude": -87.6404641 + }, + "services": [ + "Dogs", + "Cats", + "Sleep" + ], + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "", + "slug": "office/1659277149695818196", + "timezone": "America/Chicago", + "uid": 18715001, + "websiteUrl": { + "preferDisplayUrl": false, + "url": "https://locations.yext.com/us/il/chicago/500-west-madison-st-.html" + }, + "yextDisplayCoordinate": { + "latitude": 41.8823062, + "longitude": -87.6403882 + }, + "yextRoutableCoordinate": { + "latitude": 41.8818647, + "longitude": -87.6404641 + } +} \ No newline at end of file diff --git a/e2e-tests/localData/studio-stream-id-LocationPage__en__63332cafcabf752f4ecfa57bb7f83e42.json b/e2e-tests/localData/studio-stream-id-LocationPage__en__63332cafcabf752f4ecfa57bb7f83e42.json index d9c6bfb2d..22b4a6b0a 100644 --- a/e2e-tests/localData/studio-stream-id-LocationPage__en__63332cafcabf752f4ecfa57bb7f83e42.json +++ b/e2e-tests/localData/studio-stream-id-LocationPage__en__63332cafcabf752f4ecfa57bb7f83e42.json @@ -1,123 +1,123 @@ { - "__": { - "entityPageSet": {}, - "name": "LocationPage", - "streamId": "studio-stream-id-LocationPage", - "templateType": "JS" - }, - "address": { - "city": "Battle Creek", - "countryCode": "US", - "line1": "30 East Columbia Ave", - "line2": "Ste A", - "localizedCountryName": "United States", - "localizedRegionName": "Michigan", - "postalCode": "49015", - "region": "MI" - }, - "businessId": 3350634, - "cityCoordinate": { - "latitude": 42.29739, - "longitude": -85.228636 - }, - "displayCoordinate": { - "latitude": 42.2977374, - "longitude": -85.1969402 - }, - "geocodedCoordinate": { - "latitude": 42.2977374, - "longitude": -85.1969402 - }, - "hours": { - "friday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "monday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "saturday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "sunday": { - "openIntervals": [ - { - "end": "19:00", - "start": "08:00" - } - ] - }, - "thursday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "tuesday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "wednesday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - } - }, - "id": "04369", - "isoRegionCode": "MI", - "key": "0:LocationPage:knowledgeGraph:18715008:en", - "locale": "en", - "mainPhone": "+12699653237", - "meta": { - "entityType": { - "id": "location", - "uid": 0 - }, - "locale": "en" - }, - "name": "Battle Creek", - "ref_categories": null, - "ref_listings": [], - "ref_reviewsAgg": [], - "routableCoordinate": { - "latitude": 42.2985595, - "longitude": -85.1969572 - }, - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "", - "slug": "04369", - "timezone": "America/Detroit", - "uid": 18715008, - "yextDisplayCoordinate": { - "latitude": 42.2977374, - "longitude": -85.1969402 - }, - "yextRoutableCoordinate": { - "latitude": 42.2985595, - "longitude": -85.1969572 - } -} + "__": { + "entityPageSet": {}, + "name": "LocationPage", + "streamId": "studio-stream-id-LocationPage", + "templateType": "JS" + }, + "address": { + "city": "Battle Creek", + "countryCode": "US", + "line1": "30 East Columbia Ave", + "line2": "Ste A", + "localizedCountryName": "United States", + "localizedRegionName": "Michigan", + "postalCode": "49015", + "region": "MI" + }, + "businessId": 3350634, + "cityCoordinate": { + "latitude": 42.29739, + "longitude": -85.228636 + }, + "displayCoordinate": { + "latitude": 42.2977374, + "longitude": -85.1969402 + }, + "geocodedCoordinate": { + "latitude": 42.2977374, + "longitude": -85.1969402 + }, + "hours": { + "friday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "monday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "saturday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "sunday": { + "openIntervals": [ + { + "end": "19:00", + "start": "08:00" + } + ] + }, + "thursday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "tuesday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "wednesday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + } + }, + "id": "04369", + "isoRegionCode": "MI", + "key": "0:LocationPage:knowledgeGraph:18715008:en", + "locale": "en", + "mainPhone": "+12699653237", + "meta": { + "entityType": { + "id": "location", + "uid": 0 + }, + "locale": "en" + }, + "name": "Battle Creek", + "ref_categories": null, + "ref_listings": [], + "ref_reviewsAgg": [], + "routableCoordinate": { + "latitude": 42.2985595, + "longitude": -85.1969572 + }, + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "", + "slug": "04369", + "timezone": "America/Detroit", + "uid": 18715008, + "yextDisplayCoordinate": { + "latitude": 42.2977374, + "longitude": -85.1969402 + }, + "yextRoutableCoordinate": { + "latitude": 42.2985595, + "longitude": -85.1969572 + } +} \ No newline at end of file diff --git a/e2e-tests/localData/studio-stream-id-LocationPage__en__74f6cc7a9108951c20122cd3dabb7eb5.json b/e2e-tests/localData/studio-stream-id-LocationPage__en__74f6cc7a9108951c20122cd3dabb7eb5.json index 5f5d61f51..e148353a7 100644 --- a/e2e-tests/localData/studio-stream-id-LocationPage__en__74f6cc7a9108951c20122cd3dabb7eb5.json +++ b/e2e-tests/localData/studio-stream-id-LocationPage__en__74f6cc7a9108951c20122cd3dabb7eb5.json @@ -1,122 +1,122 @@ { - "__": { - "entityPageSet": {}, - "name": "LocationPage", - "streamId": "studio-stream-id-LocationPage", - "templateType": "JS" - }, - "address": { - "city": "Mansfield", - "countryCode": "US", - "line1": "1009 Park Avenue West", - "localizedCountryName": "United States", - "localizedRegionName": "Ohio", - "postalCode": "44906", - "region": "OH" - }, - "businessId": 3350634, - "cityCoordinate": { - "latitude": 40.761307, - "longitude": -82.522964 - }, - "displayCoordinate": { - "latitude": 40.758865, - "longitude": -82.5523833 - }, - "geocodedCoordinate": { - "latitude": 40.758754, - "longitude": -82.552084 - }, - "hours": { - "friday": { - "openIntervals": [ - { - "end": "21:00", - "start": "08:00" - } - ] - }, - "monday": { - "openIntervals": [ - { - "end": "21:00", - "start": "08:00" - } - ] - }, - "saturday": { - "openIntervals": [ - { - "end": "21:00", - "start": "08:00" - } - ] - }, - "sunday": { - "openIntervals": [ - { - "end": "21:00", - "start": "08:00" - } - ] - }, - "thursday": { - "openIntervals": [ - { - "end": "21:00", - "start": "08:00" - } - ] - }, - "tuesday": { - "openIntervals": [ - { - "end": "21:00", - "start": "08:00" - } - ] - }, - "wednesday": { - "openIntervals": [ - { - "end": "21:00", - "start": "08:00" - } - ] - } - }, - "id": "03037", - "isoRegionCode": "OH", - "key": "0:LocationPage:knowledgeGraph:18715000:en", - "locale": "en", - "mainPhone": "+14195257300", - "meta": { - "entityType": { - "id": "location", - "uid": 0 - }, - "locale": "en" - }, - "name": "Mansfield", - "ref_categories": null, - "ref_listings": [], - "ref_reviewsAgg": [], - "routableCoordinate": { - "latitude": 40.7591657, - "longitude": -82.5523709 - }, - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "", - "slug": "03037", - "timezone": "America/New_York", - "uid": 18715000, - "yextDisplayCoordinate": { - "latitude": 40.758865, - "longitude": -82.5523833 - }, - "yextRoutableCoordinate": { - "latitude": 40.7591657, - "longitude": -82.5523709 - } -} + "__": { + "entityPageSet": {}, + "name": "LocationPage", + "streamId": "studio-stream-id-LocationPage", + "templateType": "JS" + }, + "address": { + "city": "Mansfield", + "countryCode": "US", + "line1": "1009 Park Avenue West", + "localizedCountryName": "United States", + "localizedRegionName": "Ohio", + "postalCode": "44906", + "region": "OH" + }, + "businessId": 3350634, + "cityCoordinate": { + "latitude": 40.761307, + "longitude": -82.522964 + }, + "displayCoordinate": { + "latitude": 40.758865, + "longitude": -82.5523833 + }, + "geocodedCoordinate": { + "latitude": 40.758754, + "longitude": -82.552084 + }, + "hours": { + "friday": { + "openIntervals": [ + { + "end": "21:00", + "start": "08:00" + } + ] + }, + "monday": { + "openIntervals": [ + { + "end": "21:00", + "start": "08:00" + } + ] + }, + "saturday": { + "openIntervals": [ + { + "end": "21:00", + "start": "08:00" + } + ] + }, + "sunday": { + "openIntervals": [ + { + "end": "21:00", + "start": "08:00" + } + ] + }, + "thursday": { + "openIntervals": [ + { + "end": "21:00", + "start": "08:00" + } + ] + }, + "tuesday": { + "openIntervals": [ + { + "end": "21:00", + "start": "08:00" + } + ] + }, + "wednesday": { + "openIntervals": [ + { + "end": "21:00", + "start": "08:00" + } + ] + } + }, + "id": "03037", + "isoRegionCode": "OH", + "key": "0:LocationPage:knowledgeGraph:18715000:en", + "locale": "en", + "mainPhone": "+14195257300", + "meta": { + "entityType": { + "id": "location", + "uid": 0 + }, + "locale": "en" + }, + "name": "Mansfield", + "ref_categories": null, + "ref_listings": [], + "ref_reviewsAgg": [], + "routableCoordinate": { + "latitude": 40.7591657, + "longitude": -82.5523709 + }, + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "", + "slug": "03037", + "timezone": "America/New_York", + "uid": 18715000, + "yextDisplayCoordinate": { + "latitude": 40.758865, + "longitude": -82.5523833 + }, + "yextRoutableCoordinate": { + "latitude": 40.7591657, + "longitude": -82.5523709 + } +} \ No newline at end of file diff --git a/e2e-tests/localData/studio-stream-id-LocationPage__en__7d5f646cf2f84c4ce9ef3a0f92afe207.json b/e2e-tests/localData/studio-stream-id-LocationPage__en__7d5f646cf2f84c4ce9ef3a0f92afe207.json index b9f03e673..903116eb0 100644 --- a/e2e-tests/localData/studio-stream-id-LocationPage__en__7d5f646cf2f84c4ce9ef3a0f92afe207.json +++ b/e2e-tests/localData/studio-stream-id-LocationPage__en__7d5f646cf2f84c4ce9ef3a0f92afe207.json @@ -1,122 +1,115 @@ { - "__": { - "entityPageSet": {}, - "name": "LocationPage", - "streamId": "studio-stream-id-LocationPage", - "templateType": "JS" - }, - "address": { - "city": "Magalia", - "countryCode": "US", - "line1": "14115 Lakeridge Circle", - "localizedCountryName": "United States", - "localizedRegionName": "California", - "postalCode": "95954", - "region": "CA" - }, - "businessId": 3350634, - "cityCoordinate": { - "latitude": 39.867959, - "longitude": -121.599628 - }, - "displayCoordinate": { - "latitude": 39.817925, - "longitude": -121.591739 - }, - "geocodedCoordinate": { - "latitude": 39.817948, - "longitude": -121.591689 - }, - "hours": { - "friday": { - "openIntervals": [ - { - "end": "19:00", - "start": "08:00" - } - ] - }, - "monday": { - "openIntervals": [ - { - "end": "19:00", - "start": "08:00" - } - ] - }, - "saturday": { - "openIntervals": [ - { - "end": "19:00", - "start": "08:00" - } - ] - }, - "sunday": { - "openIntervals": [ - { - "end": "19:00", - "start": "08:00" - } - ] - }, - "thursday": { - "openIntervals": [ - { - "end": "19:00", - "start": "08:00" - } - ] - }, - "tuesday": { - "openIntervals": [ - { - "end": "19:00", - "start": "08:00" - } - ] - }, - "wednesday": { - "openIntervals": [ - { - "end": "19:00", - "start": "08:00" - } - ] - } - }, - "id": "06548", - "isoRegionCode": "CA", - "key": "0:LocationPage:knowledgeGraph:18715002:en", - "locale": "en", - "mainPhone": "+15308730800", - "meta": { - "entityType": { - "id": "location", - "uid": 0 - }, - "locale": "en" - }, - "name": "Magalia", - "ref_categories": null, - "ref_listings": [], - "ref_reviewsAgg": [], - "routableCoordinate": { - "latitude": 39.8183908, - "longitude": -121.5917993 - }, - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "", - "slug": "06548/magalia", - "timezone": "America/Los_Angeles", - "uid": 18715002, - "yextDisplayCoordinate": { - "latitude": 39.817925, - "longitude": -121.591739 - }, - "yextRoutableCoordinate": { - "latitude": 39.8183908, - "longitude": -121.5917993 - } -} + "__": { + "entityPageSet": {}, + "name": "LocationPage", + "streamId": "studio-stream-id-LocationPage", + "templateType": "JS" + }, + "address": { + "city": "Magalia", + "countryCode": "US", + "line1": "14113 Lakeridge Circle", + "localizedCountryName": "United States", + "localizedRegionName": "California", + "postalCode": "95954", + "region": "CA" + }, + "addressHidden": false, + "businessId": 3350634, + "cityCoordinate": { + "latitude": 39.867959, + "longitude": -121.599628 + }, + "geocodedCoordinate": { + "latitude": 39.8183888, + "longitude": -121.5921615 + }, + "hours": { + "friday": { + "openIntervals": [ + { + "end": "19:00", + "start": "08:00" + } + ] + }, + "monday": { + "openIntervals": [ + { + "end": "19:00", + "start": "08:00" + } + ] + }, + "saturday": { + "openIntervals": [ + { + "end": "19:00", + "start": "08:00" + } + ] + }, + "sunday": { + "openIntervals": [ + { + "end": "19:00", + "start": "08:00" + } + ] + }, + "thursday": { + "openIntervals": [ + { + "end": "19:00", + "start": "08:00" + } + ] + }, + "tuesday": { + "openIntervals": [ + { + "end": "19:00", + "start": "08:00" + } + ] + }, + "wednesday": { + "openIntervals": [ + { + "end": "19:00", + "start": "08:00" + } + ] + } + }, + "id": "06548", + "isoRegionCode": "CA", + "key": "0:LocationPage:knowledgeGraph:18715002:en", + "locale": "en", + "mainPhone": "+15308730800", + "meta": { + "entityType": { + "id": "location", + "uid": 0 + }, + "locale": "en" + }, + "name": "Magalia", + "ref_categories": null, + "ref_listings": [], + "ref_reviewsAgg": [], + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "", + "slug": "06548/magalia", + "timezone": "America/Los_Angeles", + "uid": 18715002, + "yextDisplayCoordinate": { + "latitude": 39.8183888, + "longitude": -121.5921615 + }, + "yextRoutableCoordinate": { + "latitude": 39.81815746, + "longitude": -121.58988171 + } +} \ No newline at end of file diff --git a/e2e-tests/localData/studio-stream-id-LocationPage__en__8f3df878733e5e0969823b81e3bf497f.json b/e2e-tests/localData/studio-stream-id-LocationPage__en__8f3df878733e5e0969823b81e3bf497f.json index c03ea3471..78604b42d 100644 --- a/e2e-tests/localData/studio-stream-id-LocationPage__en__8f3df878733e5e0969823b81e3bf497f.json +++ b/e2e-tests/localData/studio-stream-id-LocationPage__en__8f3df878733e5e0969823b81e3bf497f.json @@ -1,122 +1,122 @@ { - "__": { - "entityPageSet": {}, - "name": "LocationPage", - "streamId": "studio-stream-id-LocationPage", - "templateType": "JS" - }, - "address": { - "city": "Bainbridge Island", - "countryCode": "US", - "line1": "301 High School Road NE", - "localizedCountryName": "United States", - "localizedRegionName": "Washington", - "postalCode": "98110", - "region": "WA" - }, - "businessId": 3350634, - "cityCoordinate": { - "latitude": 47.647774, - "longitude": -122.538016 - }, - "displayCoordinate": { - "latitude": 47.6348298, - "longitude": -122.5182467 - }, - "geocodedCoordinate": { - "latitude": 47.6348298, - "longitude": -122.5182467 - }, - "hours": { - "friday": { - "openIntervals": [ - { - "end": "22:00", - "start": "07:00" - } - ] - }, - "monday": { - "openIntervals": [ - { - "end": "22:00", - "start": "07:00" - } - ] - }, - "saturday": { - "openIntervals": [ - { - "end": "22:00", - "start": "07:00" - } - ] - }, - "sunday": { - "openIntervals": [ - { - "end": "22:00", - "start": "07:00" - } - ] - }, - "thursday": { - "openIntervals": [ - { - "end": "22:00", - "start": "07:00" - } - ] - }, - "tuesday": { - "openIntervals": [ - { - "end": "22:00", - "start": "07:00" - } - ] - }, - "wednesday": { - "openIntervals": [ - { - "end": "22:00", - "start": "07:00" - } - ] - } - }, - "id": "05215", - "isoRegionCode": "WA", - "key": "0:LocationPage:knowledgeGraph:18715009:en", - "locale": "en", - "mainPhone": "+12068424065", - "meta": { - "entityType": { - "id": "location", - "uid": 0 - }, - "locale": "en" - }, - "name": "Bainbridge Island", - "ref_categories": null, - "ref_listings": [], - "ref_reviewsAgg": [], - "routableCoordinate": { - "latitude": 47.63576, - "longitude": -122.518235 - }, - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "", - "slug": "05215", - "timezone": "America/Los_Angeles", - "uid": 18715009, - "yextDisplayCoordinate": { - "latitude": 47.6348298, - "longitude": -122.5182467 - }, - "yextRoutableCoordinate": { - "latitude": 47.63576, - "longitude": -122.518235 - } -} + "__": { + "entityPageSet": {}, + "name": "LocationPage", + "streamId": "studio-stream-id-LocationPage", + "templateType": "JS" + }, + "address": { + "city": "Bainbridge Island", + "countryCode": "US", + "line1": "301 High School Road NE", + "localizedCountryName": "United States", + "localizedRegionName": "Washington", + "postalCode": "98110", + "region": "WA" + }, + "businessId": 3350634, + "cityCoordinate": { + "latitude": 47.647774, + "longitude": -122.538016 + }, + "displayCoordinate": { + "latitude": 47.6348298, + "longitude": -122.5182467 + }, + "geocodedCoordinate": { + "latitude": 47.6348298, + "longitude": -122.5182467 + }, + "hours": { + "friday": { + "openIntervals": [ + { + "end": "22:00", + "start": "07:00" + } + ] + }, + "monday": { + "openIntervals": [ + { + "end": "22:00", + "start": "07:00" + } + ] + }, + "saturday": { + "openIntervals": [ + { + "end": "22:00", + "start": "07:00" + } + ] + }, + "sunday": { + "openIntervals": [ + { + "end": "22:00", + "start": "07:00" + } + ] + }, + "thursday": { + "openIntervals": [ + { + "end": "22:00", + "start": "07:00" + } + ] + }, + "tuesday": { + "openIntervals": [ + { + "end": "22:00", + "start": "07:00" + } + ] + }, + "wednesday": { + "openIntervals": [ + { + "end": "22:00", + "start": "07:00" + } + ] + } + }, + "id": "05215", + "isoRegionCode": "WA", + "key": "0:LocationPage:knowledgeGraph:18715009:en", + "locale": "en", + "mainPhone": "+12068424065", + "meta": { + "entityType": { + "id": "location", + "uid": 0 + }, + "locale": "en" + }, + "name": "Bainbridge Island", + "ref_categories": null, + "ref_listings": [], + "ref_reviewsAgg": [], + "routableCoordinate": { + "latitude": 47.63576, + "longitude": -122.518235 + }, + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "", + "slug": "05215", + "timezone": "America/Los_Angeles", + "uid": 18715009, + "yextDisplayCoordinate": { + "latitude": 47.6348298, + "longitude": -122.5182467 + }, + "yextRoutableCoordinate": { + "latitude": 47.63576, + "longitude": -122.518235 + } +} \ No newline at end of file diff --git a/e2e-tests/localData/studio-stream-id-LocationPage__en__a09d94986018c82320dfe5e138ea88ef.json b/e2e-tests/localData/studio-stream-id-LocationPage__en__a09d94986018c82320dfe5e138ea88ef.json index c49725bfe..98d337dd6 100644 --- a/e2e-tests/localData/studio-stream-id-LocationPage__en__a09d94986018c82320dfe5e138ea88ef.json +++ b/e2e-tests/localData/studio-stream-id-LocationPage__en__a09d94986018c82320dfe5e138ea88ef.json @@ -1,122 +1,122 @@ { - "__": { - "entityPageSet": {}, - "name": "LocationPage", - "streamId": "studio-stream-id-LocationPage", - "templateType": "JS" - }, - "address": { - "city": "Grosse Pointe Farms", - "countryCode": "US", - "line1": "107 Kercheval Avenue", - "localizedCountryName": "United States", - "localizedRegionName": "Michigan", - "postalCode": "48236", - "region": "MI" - }, - "businessId": 3350634, - "cityCoordinate": { - "latitude": 42.40644073486328, - "longitude": -82.8927230834961 - }, - "displayCoordinate": { - "latitude": 42.395619, - "longitude": -82.90292 - }, - "geocodedCoordinate": { - "latitude": 42.395651, - "longitude": -82.902968 - }, - "hours": { - "friday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "monday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "saturday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "sunday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "thursday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "tuesday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "wednesday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - } - }, - "id": "04368", - "isoRegionCode": "MI", - "key": "0:LocationPage:knowledgeGraph:18715007:en", - "locale": "en", - "mainPhone": "+13138865655", - "meta": { - "entityType": { - "id": "location", - "uid": 0 - }, - "locale": "en" - }, - "name": "Grosse Pointe Farms", - "ref_categories": null, - "ref_listings": [], - "ref_reviewsAgg": [], - "routableCoordinate": { - "latitude": 42.3954628, - "longitude": -82.9027175 - }, - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "", - "slug": "studio/04368", - "timezone": "America/Detroit", - "uid": 18715007, - "yextDisplayCoordinate": { - "latitude": 42.395619, - "longitude": -82.90292 - }, - "yextRoutableCoordinate": { - "latitude": 42.3954628, - "longitude": -82.9027175 - } -} + "__": { + "entityPageSet": {}, + "name": "LocationPage", + "streamId": "studio-stream-id-LocationPage", + "templateType": "JS" + }, + "address": { + "city": "Grosse Pointe Farms", + "countryCode": "US", + "line1": "107 Kercheval Avenue", + "localizedCountryName": "United States", + "localizedRegionName": "Michigan", + "postalCode": "48236", + "region": "MI" + }, + "businessId": 3350634, + "cityCoordinate": { + "latitude": 42.40644073486328, + "longitude": -82.8927230834961 + }, + "displayCoordinate": { + "latitude": 42.395619, + "longitude": -82.90292 + }, + "geocodedCoordinate": { + "latitude": 42.395651, + "longitude": -82.902968 + }, + "hours": { + "friday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "monday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "saturday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "sunday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "thursday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "tuesday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "wednesday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + } + }, + "id": "04368", + "isoRegionCode": "MI", + "key": "0:LocationPage:knowledgeGraph:18715007:en", + "locale": "en", + "mainPhone": "+13138865655", + "meta": { + "entityType": { + "id": "location", + "uid": 0 + }, + "locale": "en" + }, + "name": "Grosse Pointe Farms", + "ref_categories": null, + "ref_listings": [], + "ref_reviewsAgg": [], + "routableCoordinate": { + "latitude": 42.3954628, + "longitude": -82.9027175 + }, + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "", + "slug": "studio/04368", + "timezone": "America/Detroit", + "uid": 18715007, + "yextDisplayCoordinate": { + "latitude": 42.395619, + "longitude": -82.90292 + }, + "yextRoutableCoordinate": { + "latitude": 42.3954628, + "longitude": -82.9027175 + } +} \ No newline at end of file diff --git a/e2e-tests/localData/studio-stream-id-LocationPage__en__ab9a660c88afbd8dafb14c8c8b281274.json b/e2e-tests/localData/studio-stream-id-LocationPage__en__ab9a660c88afbd8dafb14c8c8b281274.json index 83a572324..ef65c8824 100644 --- a/e2e-tests/localData/studio-stream-id-LocationPage__en__ab9a660c88afbd8dafb14c8c8b281274.json +++ b/e2e-tests/localData/studio-stream-id-LocationPage__en__ab9a660c88afbd8dafb14c8c8b281274.json @@ -1,122 +1,122 @@ { - "__": { - "entityPageSet": {}, - "name": "LocationPage", - "streamId": "studio-stream-id-LocationPage", - "templateType": "JS" - }, - "address": { - "city": "Needles", - "countryCode": "US", - "line1": "1020 East Broadway Street", - "localizedCountryName": "United States", - "localizedRegionName": "California", - "postalCode": "92363", - "region": "CA" - }, - "businessId": 3350634, - "cityCoordinate": { - "latitude": 34.838470458984375, - "longitude": -114.60433197021484 - }, - "displayCoordinate": { - "latitude": 34.8249062, - "longitude": -114.5947005 - }, - "geocodedCoordinate": { - "latitude": 34.8249062, - "longitude": -114.5947005 - }, - "hours": { - "friday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "monday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "saturday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "sunday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "thursday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "tuesday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - }, - "wednesday": { - "openIntervals": [ - { - "end": "22:00", - "start": "08:00" - } - ] - } - }, - "id": "05699", - "isoRegionCode": "CA", - "key": "0:LocationPage:knowledgeGraph:18715006:en", - "locale": "en", - "mainPhone": "+17603262944", - "meta": { - "entityType": { - "id": "location", - "uid": 0 - }, - "locale": "en" - }, - "name": "Needles", - "ref_categories": null, - "ref_listings": [], - "ref_reviewsAgg": [], - "routableCoordinate": { - "latitude": 34.8253943, - "longitude": -114.5963464 - }, - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "", - "slug": "studio/05699", - "timezone": "America/Los_Angeles", - "uid": 18715006, - "yextDisplayCoordinate": { - "latitude": 34.8249062, - "longitude": -114.5947005 - }, - "yextRoutableCoordinate": { - "latitude": 34.8253943, - "longitude": -114.5963464 - } -} + "__": { + "entityPageSet": {}, + "name": "LocationPage", + "streamId": "studio-stream-id-LocationPage", + "templateType": "JS" + }, + "address": { + "city": "Needles", + "countryCode": "US", + "line1": "1020 East Broadway Street", + "localizedCountryName": "United States", + "localizedRegionName": "California", + "postalCode": "92363", + "region": "CA" + }, + "businessId": 3350634, + "cityCoordinate": { + "latitude": 34.838470458984375, + "longitude": -114.60433197021484 + }, + "displayCoordinate": { + "latitude": 34.8249062, + "longitude": -114.5947005 + }, + "geocodedCoordinate": { + "latitude": 34.8249062, + "longitude": -114.5947005 + }, + "hours": { + "friday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "monday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "saturday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "sunday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "thursday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "tuesday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + }, + "wednesday": { + "openIntervals": [ + { + "end": "22:00", + "start": "08:00" + } + ] + } + }, + "id": "05699", + "isoRegionCode": "CA", + "key": "0:LocationPage:knowledgeGraph:18715006:en", + "locale": "en", + "mainPhone": "+17603262944", + "meta": { + "entityType": { + "id": "location", + "uid": 0 + }, + "locale": "en" + }, + "name": "Needles", + "ref_categories": null, + "ref_listings": [], + "ref_reviewsAgg": [], + "routableCoordinate": { + "latitude": 34.8253943, + "longitude": -114.5963464 + }, + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "", + "slug": "studio/05699", + "timezone": "America/Los_Angeles", + "uid": 18715006, + "yextDisplayCoordinate": { + "latitude": 34.8249062, + "longitude": -114.5947005 + }, + "yextRoutableCoordinate": { + "latitude": 34.8253943, + "longitude": -114.5963464 + } +} \ No newline at end of file diff --git a/e2e-tests/localData/studio-stream-id-LocationPage__en__b5c72eb6622ba376c857dbedac25989b.json b/e2e-tests/localData/studio-stream-id-LocationPage__en__b5c72eb6622ba376c857dbedac25989b.json index 5743ab55c..5a509bb88 100644 --- a/e2e-tests/localData/studio-stream-id-LocationPage__en__b5c72eb6622ba376c857dbedac25989b.json +++ b/e2e-tests/localData/studio-stream-id-LocationPage__en__b5c72eb6622ba376c857dbedac25989b.json @@ -1,124 +1,133 @@ { - "__": { - "entityPageSet": {}, - "name": "LocationPage", - "streamId": "studio-stream-id-LocationPage", - "templateType": "JS" - }, - "address": { - "city": "New York", - "countryCode": "US", - "line1": "1 Madison Ave", - "line2": "5th Floor", - "localizedCountryName": "United States", - "localizedRegionName": "New York", - "postalCode": "10010", - "region": "NY" - }, - "addressHidden": false, - "businessId": 3350634, - "c_features": ["OPEN_NOW", "DOG_FRIENDLY"], - "c_servicesOffered": ["Test Service"], - "cityCoordinate": { - "latitude": 40.708601, - "longitude": -73.876717 - }, - "description": "Yext is the global digital knowledge management leader, and our Knowledge Engine puts businesses in control of their digital knowledge.", - "displayCoordinate": { - "latitude": 40.7410895, - "longitude": -73.9875092 - }, - "geocodedCoordinate": { - "latitude": 40.7410895, - "longitude": -73.98750919999999 - }, - "hours": { - "friday": { - "isClosed": true - }, - "monday": { - "openIntervals": [ - { - "end": "14:00", - "start": "01:00" - } - ] - }, - "saturday": { - "isClosed": true - }, - "sunday": { - "isClosed": true - }, - "thursday": { - "isClosed": true - }, - "tuesday": { - "openIntervals": [ - { - "end": "16:00", - "start": "03:00" - } - ] - }, - "wednesday": { - "openIntervals": [ - { - "end": "17:00", - "start": "04:00" - }, - { - "end": "19:00", - "start": "18:00" - } - ] - } - }, - "id": "637478382857487577", - "isoRegionCode": "NY", - "key": "0:LocationPage:knowledgeGraph:18714997:en", - "localPhone": "+12128136543", - "locale": "en", - "mainPhone": "+18884442988", - "meta": { - "entityType": { - "id": "location", - "uid": 0 - }, - "locale": "en" - }, - "name": "Office Space", - "priceRange": "TWO", - "ref_categories": [ - { - "id": "668", - "name": "Software Consultant", - "uid": 668 - } - ], - "ref_listings": [], - "ref_reviewsAgg": [], - "routableCoordinate": { - "latitude": 40.7411641, - "longitude": -73.9878306 - }, - "services": ["Dogs", "Cats", "Sleep"], - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "", - "slug": "office/637478382857487577", - "timezone": "America/New_York", - "uid": 18714997, - "websiteUrl": { - "preferDisplayUrl": false, - "url": "https://locations.yext.com/us/ny/new-york/1-madison-ave.html" - }, - "yextDisplayCoordinate": { - "latitude": 40.7410895, - "longitude": -73.9875092 - }, - "yextRoutableCoordinate": { - "latitude": 40.7411641, - "longitude": -73.9878306 - } -} + "__": { + "entityPageSet": {}, + "name": "LocationPage", + "streamId": "studio-stream-id-LocationPage", + "templateType": "JS" + }, + "address": { + "city": "New York", + "countryCode": "US", + "line1": "1 Madison Ave", + "line2": "5th Floor", + "localizedCountryName": "United States", + "localizedRegionName": "New York", + "postalCode": "10010", + "region": "NY" + }, + "addressHidden": false, + "businessId": 3350634, + "c_features": [ + "OPEN_NOW", + "DOG_FRIENDLY" + ], + "c_servicesOffered": [ + "Test Service" + ], + "cityCoordinate": { + "latitude": 40.708601, + "longitude": -73.876717 + }, + "description": "Yext is the global digital knowledge management leader, and our Knowledge Engine puts businesses in control of their digital knowledge.", + "displayCoordinate": { + "latitude": 40.7410895, + "longitude": -73.9875092 + }, + "geocodedCoordinate": { + "latitude": 40.7410895, + "longitude": -73.98750919999999 + }, + "hours": { + "friday": { + "isClosed": true + }, + "monday": { + "openIntervals": [ + { + "end": "14:00", + "start": "01:00" + } + ] + }, + "saturday": { + "isClosed": true + }, + "sunday": { + "isClosed": true + }, + "thursday": { + "isClosed": true + }, + "tuesday": { + "openIntervals": [ + { + "end": "16:00", + "start": "03:00" + } + ] + }, + "wednesday": { + "openIntervals": [ + { + "end": "17:00", + "start": "04:00" + }, + { + "end": "19:00", + "start": "18:00" + } + ] + } + }, + "id": "637478382857487577", + "isoRegionCode": "NY", + "key": "0:LocationPage:knowledgeGraph:18714997:en", + "localPhone": "+12128136543", + "locale": "en", + "mainPhone": "+18884442988", + "meta": { + "entityType": { + "id": "location", + "uid": 0 + }, + "locale": "en" + }, + "name": "Office Space", + "priceRange": "TWO", + "ref_categories": [ + { + "id": "668", + "name": "Software Consultant", + "uid": 668 + } + ], + "ref_listings": [], + "ref_reviewsAgg": [], + "routableCoordinate": { + "latitude": 40.7411641, + "longitude": -73.9878306 + }, + "services": [ + "Dogs", + "Cats", + "Sleep" + ], + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "", + "slug": "office/637478382857487577", + "timezone": "America/New_York", + "uid": 18714997, + "websiteUrl": { + "preferDisplayUrl": false, + "url": "https://locations.yext.com/us/ny/new-york/1-madison-ave.html" + }, + "yextDisplayCoordinate": { + "latitude": 40.7410895, + "longitude": -73.9875092 + }, + "yextRoutableCoordinate": { + "latitude": 40.7411641, + "longitude": -73.9878306 + } +} \ No newline at end of file diff --git a/e2e-tests/localData/studio-stream-id-LocationPage__en__c436bc541570239fdbb3c86a549f7a71.json b/e2e-tests/localData/studio-stream-id-LocationPage__en__c436bc541570239fdbb3c86a549f7a71.json index 9c2bb296e..bb34b4df8 100644 --- a/e2e-tests/localData/studio-stream-id-LocationPage__en__c436bc541570239fdbb3c86a549f7a71.json +++ b/e2e-tests/localData/studio-stream-id-LocationPage__en__c436bc541570239fdbb3c86a549f7a71.json @@ -1,134 +1,141 @@ { - "__": { - "entityPageSet": {}, - "name": "LocationPage", - "streamId": "studio-stream-id-LocationPage", - "templateType": "JS" - }, - "address": { - "city": "McLean", - "countryCode": "US", - "line1": "7900 Westpark Drive", - "line2": "Suite T200", - "localizedCountryName": "United States", - "localizedRegionName": "Virginia", - "postalCode": "22102", - "region": "VA" - }, - "addressHidden": false, - "businessId": 3350634, - "c_names": ["my name is Steve", "your name is Rose"], - "cityCoordinate": { - "latitude": 38.936519622802734, - "longitude": -77.18428039550781 - }, - "description": "Yext is the global digital knowledge management leader, and our Knowledge Engine puts businesses in control of their digital knowledge.", - "displayCoordinate": { - "latitude": 38.9246498, - "longitude": -77.2169181 - }, - "facebookPageUrl": "https://www.facebook.com/Yext-Cafe-2073644659328705/", - "geocodedCoordinate": { - "latitude": 38.9246498, - "longitude": -77.2169181 - }, - "hours": { - "friday": { - "openIntervals": [ - { - "end": "14:00", - "start": "12:00" - } - ] - }, - "monday": { - "openIntervals": [ - { - "end": "14:00", - "start": "01:00" - } - ] - }, - "saturday": { - "openIntervals": [ - { - "end": "13:00", - "start": "12:00" - } - ] - }, - "sunday": { - "isClosed": true - }, - "thursday": { - "isClosed": true - }, - "tuesday": { - "openIntervals": [ - { - "end": "15:00", - "start": "02:00" - }, - { - "end": "17:00", - "start": "16:00" - } - ] - }, - "wednesday": { - "openIntervals": [ - { - "end": "23:59", - "start": "00:00" - } - ] - } - }, - "id": "2917513710699998040", - "isoRegionCode": "VA", - "key": "0:LocationPage:knowledgeGraph:18714998:en", - "localPhone": "+16467624579", - "locale": "en", - "mainPhone": "+18884442988", - "meta": { - "entityType": { - "id": "location", - "uid": 0 - }, - "locale": "en" - }, - "name": "Office Space", - "ref_categories": [ - { - "id": "668", - "name": "Software Consultant", - "uid": 668 - } - ], - "ref_listings": [], - "ref_reviewsAgg": [], - "routableCoordinate": { - "latitude": 38.9243984, - "longitude": -77.2178386 - }, - "services": ["Dogs", "Cats", "Sleep"], - "siteDomain": "", - "siteId": 0, - "siteInternalHostName": "", - "slug": "office/2917513710699998040", - "timezone": "America/New_York", - "uid": 18714998, - "websiteUrl": { - "displayUrl": "https://google.com", - "preferDisplayUrl": false, - "url": "https://locations.yext.com/us/va/mclean/7900-westpark-drive.html" - }, - "yextDisplayCoordinate": { - "latitude": 38.9246498, - "longitude": -77.2169181 - }, - "yextRoutableCoordinate": { - "latitude": 38.9243984, - "longitude": -77.2178386 - } -} + "__": { + "entityPageSet": {}, + "name": "LocationPage", + "streamId": "studio-stream-id-LocationPage", + "templateType": "JS" + }, + "address": { + "city": "McLean", + "countryCode": "US", + "line1": "7900 Westpark Drive", + "line2": "Suite T200", + "localizedCountryName": "United States", + "localizedRegionName": "Virginia", + "postalCode": "22102", + "region": "VA" + }, + "addressHidden": false, + "businessId": 3350634, + "c_names": [ + "my name is Steve", + "your name is Rose" + ], + "cityCoordinate": { + "latitude": 38.936519622802734, + "longitude": -77.18428039550781 + }, + "description": "Yext is the global digital knowledge management leader, and our Knowledge Engine puts businesses in control of their digital knowledge.", + "displayCoordinate": { + "latitude": 38.9246498, + "longitude": -77.2169181 + }, + "facebookPageUrl": "https://www.facebook.com/Yext-Cafe-2073644659328705/", + "geocodedCoordinate": { + "latitude": 38.9246498, + "longitude": -77.2169181 + }, + "hours": { + "friday": { + "openIntervals": [ + { + "end": "14:00", + "start": "12:00" + } + ] + }, + "monday": { + "openIntervals": [ + { + "end": "14:00", + "start": "01:00" + } + ] + }, + "saturday": { + "openIntervals": [ + { + "end": "13:00", + "start": "12:00" + } + ] + }, + "sunday": { + "isClosed": true + }, + "thursday": { + "isClosed": true + }, + "tuesday": { + "openIntervals": [ + { + "end": "15:00", + "start": "02:00" + }, + { + "end": "17:00", + "start": "16:00" + } + ] + }, + "wednesday": { + "openIntervals": [ + { + "end": "23:59", + "start": "00:00" + } + ] + } + }, + "id": "2917513710699998040", + "isoRegionCode": "VA", + "key": "0:LocationPage:knowledgeGraph:18714998:en", + "localPhone": "+16467624579", + "locale": "en", + "mainPhone": "+18884442988", + "meta": { + "entityType": { + "id": "location", + "uid": 0 + }, + "locale": "en" + }, + "name": "Office Space", + "ref_categories": [ + { + "id": "668", + "name": "Software Consultant", + "uid": 668 + } + ], + "ref_listings": [], + "ref_reviewsAgg": [], + "routableCoordinate": { + "latitude": 38.9243984, + "longitude": -77.2178386 + }, + "services": [ + "Dogs", + "Cats", + "Sleep" + ], + "siteDomain": "", + "siteId": 0, + "siteInternalHostName": "", + "slug": "office/2917513710699998040", + "timezone": "America/New_York", + "uid": 18714998, + "websiteUrl": { + "displayUrl": "https://google.com", + "preferDisplayUrl": false, + "url": "https://locations.yext.com/us/va/mclean/7900-westpark-drive.html" + }, + "yextDisplayCoordinate": { + "latitude": 38.9246498, + "longitude": -77.2169181 + }, + "yextRoutableCoordinate": { + "latitude": 38.9243984, + "longitude": -77.2178386 + } +} \ No newline at end of file diff --git a/e2e-tests/tests/infra/StudioPlaywrightPage.ts b/e2e-tests/tests/infra/StudioPlaywrightPage.ts index 882cb91e1..f38959756 100644 --- a/e2e-tests/tests/infra/StudioPlaywrightPage.ts +++ b/e2e-tests/tests/infra/StudioPlaywrightPage.ts @@ -284,4 +284,19 @@ export default class StudioPlaywrightPage { await this.waitForIFrameImagesToLoad(); await expect(this.preview.locator("body")).toHaveScreenshot(); } + + async reload() { + await this.page.reload(); + await this.waitForLoadState(); + } + + /** + * Waits for the LoadingOverlay to finish. + */ + async waitForLoadState() { + await this.page.waitForLoadState(); + await expect( + this.page.getByRole("button", { name: "Open Add Element Menu" }) + ).toBeVisible(); + } } diff --git a/e2e-tests/tests/infra/studioTest.ts b/e2e-tests/tests/infra/studioTest.ts index 55eb17119..e493cfac0 100644 --- a/e2e-tests/tests/infra/studioTest.ts +++ b/e2e-tests/tests/infra/studioTest.ts @@ -34,8 +34,8 @@ export const studioTest = base.extend({ const opts = { createRemote, debug, testInfo, tailwindConfigPath }; await setupAcceptance(opts, async (port: number, tmpDir: string) => { await page.goto("localhost:" + port); - await page.waitForLoadState(); const studioPage = new StudioPlaywrightPage(page, tmpDir); + await studioPage.waitForLoadState(); await use(studioPage); }); }, diff --git a/e2e-tests/tests/remove-static-page.spec.ts b/e2e-tests/tests/remove-static-page.spec.ts index 5f23c4639..0a410e69c 100644 --- a/e2e-tests/tests/remove-static-page.spec.ts +++ b/e2e-tests/tests/remove-static-page.spec.ts @@ -13,6 +13,6 @@ studioTest("can remove a static page", async ({ page, studioPage }) => { await studioPage.takePageScreenshotAfterImgRender(); // Ensure that the page is still deleted after a browser refresh. - await page.reload(); + await studioPage.reload(); await studioPage.takePageScreenshotAfterImgRender(); }); diff --git a/packages/studio-ui/.size-limit.cjs b/packages/studio-ui/.size-limit.cjs index 329cf0193..342ba4516 100644 --- a/packages/studio-ui/.size-limit.cjs +++ b/packages/studio-ui/.size-limit.cjs @@ -1,6 +1,6 @@ module.exports = [ { - path: "lib/src/index.js", + path: "lib/**/*.js", limit: "850 kB", gzip: false, }, diff --git a/packages/studio-ui/src/App.tsx b/packages/studio-ui/src/App.tsx index ea54fd794..e18d1d80b 100644 --- a/packages/studio-ui/src/App.tsx +++ b/packages/studio-ui/src/App.tsx @@ -6,7 +6,7 @@ import LeftSidebar from "./components/LeftSidebar"; export default function App() { return ( -
+ <>
@@ -16,6 +16,6 @@ export default function App() {
- + ); } diff --git a/packages/studio-ui/src/AppWithLazyLoading.tsx b/packages/studio-ui/src/AppWithLazyLoading.tsx new file mode 100644 index 000000000..923b26b99 --- /dev/null +++ b/packages/studio-ui/src/AppWithLazyLoading.tsx @@ -0,0 +1,77 @@ +import LoadingOverlay from "./components/LoadingOverlay"; +import { Suspense, lazy, useEffect, useState } from "react"; +import useStudioStore from "./store/useStudioStore"; +import ProgressBar from "./components/ProgressBar"; +import loadComponents from "./utils/loadComponents"; +import classNames from "classnames"; + +const AppPromise = import("./App"); +const App = lazy(() => AppPromise); + +export default function AppWithLazyLoading() { + const [loadedCount, totalCount] = useStudioStore((store) => [ + Object.keys(store.fileMetadatas.UUIDToImportedComponent).length, + Object.keys(store.fileMetadatas.UUIDToFileMetadata).length, + ]); + const componentsLoaded = loadedCount === totalCount; + const [appLoaded, setAppLoaded] = useState(false); + + useEffect(() => { + loadComponents(); + void AppPromise.then(() => setAppLoaded(true)); + }, []); + + return ( + + {renderComponentLoadingProgress( + loadedCount, + totalCount, + componentsLoaded + )} + {renderBundleMessage(appLoaded)} + + } + > + + + + + ); +} + +function renderComponentLoadingProgress( + loadedCount: number, + totalCount: number, + componentsLoaded: boolean +) { + const msg = componentsLoaded + ? "components loaded!" + : `loading components... (${loadedCount}/${totalCount})`; + + return ( + <> + +
+ {msg} +
+ + ); +} + +function renderBundleMessage(appLoaded: boolean) { + const className = classNames("text-sky-600 mt-4", { + "animate-pulse": !appLoaded, + }); + const msg = appLoaded + ? "Studio resources loaded!" + : "... loading Studio resources ..."; + + return
{msg}
; +} diff --git a/packages/studio-ui/src/components/ComponentPreview.tsx b/packages/studio-ui/src/components/ComponentPreview.tsx index c8a8ff769..56a97ada0 100644 --- a/packages/studio-ui/src/components/ComponentPreview.tsx +++ b/packages/studio-ui/src/components/ComponentPreview.tsx @@ -62,8 +62,8 @@ function useElement( } else { const importedComponent = UUIDToImportedComponent[c.metadataUUID]; if (!importedComponent) { - console.warn( - `Expected to find component loaded for ${c.componentName} but none found - possibly due to a race condition.` + console.error( + `Expected to find component loaded for ${c.componentName} but none found.` ); return undefined; } diff --git a/packages/studio-ui/src/components/LoadingOverlay.tsx b/packages/studio-ui/src/components/LoadingOverlay.tsx new file mode 100644 index 000000000..5fdf9e64c --- /dev/null +++ b/packages/studio-ui/src/components/LoadingOverlay.tsx @@ -0,0 +1,35 @@ +import { PropsWithChildren, ReactNode } from "react"; +import classNames from "classnames"; + +export default function LoadingOverlay( + props: PropsWithChildren<{ + loading: boolean; + overlay: ReactNode; + }> +) { + const { loading, overlay } = props; + + const childrenWrapperClassname = classNames( + "transition-opacity duration-500", + { + "opacity-100": !loading, + "opacity-0 pointer-events-none": loading, + } + ); + + const overlayClassname = classNames( + "transition-opacity duration-500", + "h-full w-full flex absolute justify-center items-center flex-col", + { + "opacity-100": loading, + "opacity-0 pointer-events-none": !loading, + } + ); + + return ( + <> +
{overlay}
+
{props.children}
+ + ); +} diff --git a/packages/studio-ui/src/components/PreviewWithUseComponents.tsx b/packages/studio-ui/src/components/PreviewWithUseComponents.tsx index 222b9b50d..11d3fe07b 100644 --- a/packages/studio-ui/src/components/PreviewWithUseComponents.tsx +++ b/packages/studio-ui/src/components/PreviewWithUseComponents.tsx @@ -1,5 +1,3 @@ -import useImportedComponents from "../hooks/useImportedComponents"; -import useStudioStore from "../store/useStudioStore"; import PreviewPanel from "./PreviewPanel"; import Highlighter from "./Highlighter"; import IFramePortal from "./IFramePortal"; @@ -14,10 +12,6 @@ export default function PreviewWithUseComponents() { anchorSelect: "", }); const [iframeEl, setIframeEl] = useState(null); - const componentTree = useStudioStore((store) => - store.actions.getComponentTree() - ); - void useImportedComponents(componentTree); return ( <> diff --git a/packages/studio-ui/src/components/ProgressBar.tsx b/packages/studio-ui/src/components/ProgressBar.tsx new file mode 100644 index 000000000..2505aa747 --- /dev/null +++ b/packages/studio-ui/src/components/ProgressBar.tsx @@ -0,0 +1,21 @@ +import { CSSProperties, memo, useMemo } from "react"; + +export default memo(ProgressBar); + +function ProgressBar(props: { progressFraction: number }) { + const progressStyles: CSSProperties = useMemo(() => { + return { + width: `${Math.floor(props.progressFraction * 20) * 5}%`, + transition: "width 1s", + }; + }, [props.progressFraction]); + + return ( +
+
+
+ ); +} diff --git a/packages/studio-ui/src/hooks/useImportedComponents.tsx b/packages/studio-ui/src/hooks/useImportedComponents.tsx deleted file mode 100644 index a2d597c2f..000000000 --- a/packages/studio-ui/src/hooks/useImportedComponents.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { useMemo } from "react"; -import useStudioStore from "../store/useStudioStore"; -import { ComponentState } from "@yext/studio-plugin"; - -/** - * Load all functional component methods corresponding to the components - * used in the provided page state's component tree. - */ -export default async function useImportedComponents( - componentTree?: ComponentState[] -): Promise { - const importComponent = useStudioStore( - (store) => store.actions.importComponent - ); - - return useMemo(async () => { - if (!componentTree) { - return; - } - await Promise.all(componentTree.map((c) => importComponent(c))); - }, [componentTree, importComponent]); -} diff --git a/packages/studio-ui/src/index.ts b/packages/studio-ui/src/index.ts index e414915ce..65d05422c 100644 --- a/packages/studio-ui/src/index.ts +++ b/packages/studio-ui/src/index.ts @@ -1,3 +1,3 @@ -export { default as App } from "./App"; +export { default as AppWithLazyLoading } from "./AppWithLazyLoading"; export { hotReloadStudioData, hotReloadGitData } from "./store/hotReloadStore"; export { StudioHMRUpdateID, GitDataHMRUpdateID } from "@yext/studio-plugin"; diff --git a/packages/studio-ui/src/store/StudioActions.ts b/packages/studio-ui/src/store/StudioActions.ts index 11f832796..b2195aa5b 100644 --- a/packages/studio-ui/src/store/StudioActions.ts +++ b/packages/studio-ui/src/store/StudioActions.ts @@ -16,7 +16,6 @@ import StudioConfigSlice from "./models/slices/StudioConfigSlice"; import AddComponentAction from "./StudioActions/AddComponentAction"; import CreateComponentStateAction from "./StudioActions/CreateComponentStateAction"; import UpdateActivePageAction from "./StudioActions/UpdateActivePageAction"; -import ImportComponentAction from "./StudioActions/ImportComponentAction"; import GenerateTestDataAction from "./StudioActions/GenerateTestDataAction"; import CreatePageAction from "./StudioActions/CreatePageAction"; import dynamicImportFromBrowser from "../utils/dynamicImportFromBrowser"; @@ -27,7 +26,6 @@ export default class StudioActions { public addComponent: AddComponentAction["addComponent"]; public createComponentState: CreateComponentStateAction["createComponentState"]; public updateActivePage: UpdateActivePageAction["updateActivePage"]; - public importComponent: ImportComponentAction["importComponent"]; public generateTestData: GenerateTestDataAction["generateTestData"]; public createPage: CreatePageAction["createPage"]; @@ -45,9 +43,6 @@ export default class StudioActions { getPages, this ).updateActivePage; - this.importComponent = new ImportComponentAction( - getFileMetadatas - ).importComponent; this.generateTestData = new GenerateTestDataAction( getPages, this diff --git a/packages/studio-ui/src/store/StudioActions/ImportComponentAction.ts b/packages/studio-ui/src/store/StudioActions/ImportComponentAction.ts deleted file mode 100644 index e16621426..000000000 --- a/packages/studio-ui/src/store/StudioActions/ImportComponentAction.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { - ComponentState, - ComponentStateKind, - ErrorComponentState, - FileMetadata, - StandardComponentState, -} from "@yext/studio-plugin"; -import FileMetadataSlice from "../models/slices/FileMetadataSlice"; -import dynamicImportFromBrowser from "../../utils/dynamicImportFromBrowser"; -import getFunctionComponent from "../../utils/getFunctionComponent"; - -/** - * Imports a component into the global store. - */ -export default class ImportComponentAction { - constructor(private getFileMetadataSlice: () => FileMetadataSlice) {} - - importComponent = async (c: ComponentState): Promise => { - if ( - c.kind !== ComponentStateKind.Standard && - c.kind !== ComponentStateKind.Error - ) { - return; - } - - await this.importStandardOrErrorComponentState(c); - }; - - private importStandardOrErrorComponentState = async ( - componentState: StandardComponentState | ErrorComponentState - ) => { - const { metadataUUID, componentName } = componentState; - const { getFileMetadata, UUIDToImportedComponent } = - this.getFileMetadataSlice(); - if (UUIDToImportedComponent.hasOwnProperty(metadataUUID)) { - return; - } - - const metadata: FileMetadata | undefined = getFileMetadata(metadataUUID); - if (!metadata) { - return; - } - - const importedValue = await dynamicImportFromBrowser(metadata.filepath); - const functionComponent = getFunctionComponent( - importedValue, - componentName - ); - - if (functionComponent) { - this.getFileMetadataSlice().setImportedComponent( - metadataUUID, - functionComponent - ); - } - }; -} diff --git a/packages/studio-ui/src/store/hotReloadStore.ts b/packages/studio-ui/src/store/hotReloadStore.ts index cfb9d37ce..59642a0f2 100644 --- a/packages/studio-ui/src/store/hotReloadStore.ts +++ b/packages/studio-ui/src/store/hotReloadStore.ts @@ -6,7 +6,6 @@ import { import useStudioStore from "./useStudioStore"; import removeTopLevelFragments from "../utils/removeTopLevelFragments"; import dynamicImportFromBrowser from "../utils/dynamicImportFromBrowser"; -import path from "path-browserify"; import getFunctionComponent from "../utils/getFunctionComponent"; /** @@ -66,10 +65,7 @@ async function syncFileMetadata(studioData: StudioData, file: string) { const importedFile = await dynamicImportFromBrowser( file + `?timestamp=${Date.now()}` ); - const componentFunction = getFunctionComponent( - importedFile, - path.basename(file, ".tsx") - ); + const componentFunction = getFunctionComponent(importedFile); if (componentFunction) { useStudioStore .getState() diff --git a/packages/studio-ui/src/utils/getFunctionComponent.ts b/packages/studio-ui/src/utils/getFunctionComponent.ts index 9dfd6ebcb..dafcb2507 100644 --- a/packages/studio-ui/src/utils/getFunctionComponent.ts +++ b/packages/studio-ui/src/utils/getFunctionComponent.ts @@ -1,15 +1,7 @@ -import { FunctionComponent } from "react"; import { ImportType } from "../store/models/ImportType"; export default function getFunctionComponent( - importedValue: Record, - name: string + importedValue: Record ): ImportType | undefined { - if (typeof importedValue[name] === "function") { - return importedValue[name] as FunctionComponent; - } else if (typeof importedValue["default"] === "function") { - return importedValue["default"] as FunctionComponent; - } else { - console.error(`${name} is not a valid functional component.`); - } + return importedValue["default"] as ImportType | undefined; } diff --git a/packages/studio-ui/src/utils/loadComponents.tsx b/packages/studio-ui/src/utils/loadComponents.tsx new file mode 100644 index 000000000..eac53d2b7 --- /dev/null +++ b/packages/studio-ui/src/utils/loadComponents.tsx @@ -0,0 +1,27 @@ +import useStudioStore from "../store/useStudioStore"; +import getFunctionComponent from "./getFunctionComponent"; +import dynamicImportFromBrowser from "./dynamicImportFromBrowser"; + +/** + * Load all of the user's components into the store. + */ +export default function loadComponents(): Promise[] { + const { UUIDToFileMetadata, setImportedComponent, UUIDToImportedComponent } = + useStudioStore.getState().fileMetadatas; + + const componentImportPromises = Object.values(UUIDToFileMetadata).map( + async (fileMetadata) => { + if (UUIDToImportedComponent.hasOwnProperty(fileMetadata.metadataUUID)) { + return; + } + const importedModule = await dynamicImportFromBrowser( + fileMetadata.filepath + ); + const functionComponent = getFunctionComponent(importedModule); + if (functionComponent) { + setImportedComponent(fileMetadata.metadataUUID, functionComponent); + } + } + ); + return componentImportPromises; +} diff --git a/packages/studio-ui/tests/components/PreviewPanel.test.tsx b/packages/studio-ui/tests/components/PreviewPanel.test.tsx index 780da0ba6..f5bba8fd5 100644 --- a/packages/studio-ui/tests/components/PreviewPanel.test.tsx +++ b/packages/studio-ui/tests/components/PreviewPanel.test.tsx @@ -1,4 +1,4 @@ -import { within, screen, render, renderHook } from "@testing-library/react"; +import { within, screen, render } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import PreviewPanel from "../../src/components/PreviewPanel"; import useStudioStore from "../../src/store/useStudioStore"; @@ -13,7 +13,7 @@ import { PropValueKind, PropValueType, } from "@yext/studio-plugin"; -import useImportedComponents from "../../src/hooks/useImportedComponents"; +import loadComponents from "../../src/utils/loadComponents"; const mockSetState = jest.fn(); @@ -169,5 +169,5 @@ async function mockPreviewState(componentTree: ComponentState[]) { }, }); await useStudioStore.getState().actions.updateActivePage("universalPage"); - await renderHook(() => useImportedComponents(componentTree)).result.current; + await Promise.all(loadComponents()); } diff --git a/packages/studio-ui/tests/hooks/useImportedComponents.test.tsx b/packages/studio-ui/tests/utils/loadComponents.test.tsx similarity index 53% rename from packages/studio-ui/tests/hooks/useImportedComponents.test.tsx rename to packages/studio-ui/tests/utils/loadComponents.test.tsx index 8d5f88325..0658a2578 100644 --- a/packages/studio-ui/tests/hooks/useImportedComponents.test.tsx +++ b/packages/studio-ui/tests/utils/loadComponents.test.tsx @@ -1,12 +1,8 @@ -import { - ComponentStateKind, - FileMetadataKind, - PageState, -} from "@yext/studio-plugin"; -import useImportedComponents from "../../src/hooks/useImportedComponents"; +import { FileMetadataKind } from "@yext/studio-plugin"; +import loadComponents from "../../src/utils/loadComponents"; import mockStore, { MockStudioStore } from "../__utils__/mockStore"; import path from "path"; -import { waitFor, renderHook } from "@testing-library/react"; +import { waitFor } from "@testing-library/react"; import useStudioStore from "../../src/store/useStudioStore"; const mockStoreState: MockStudioStore = { @@ -27,30 +23,9 @@ const mockStoreState: MockStudioStore = { }, }; -const pageState: PageState = { - componentTree: [ - { - kind: ComponentStateKind.Standard, - componentName: "Banner", - props: {}, - uuid: "banner-uuid", - metadataUUID: "banner-metadata-uuid", - }, - { - kind: ComponentStateKind.Standard, - componentName: "Container", - props: {}, - uuid: "container-uuid", - metadataUUID: "container-metadata-uuid", - }, - ], - cssImports: [], - filepath: "some/file/path", -}; - -it("loads functional components based on provided page state", async () => { +it("loads all components", async () => { mockStore(mockStoreState); - renderHook(() => useImportedComponents(pageState.componentTree)); + await Promise.all(loadComponents()); await waitFor(() => { expect( useStudioStore.getState().fileMetadatas.UUIDToImportedComponent diff --git a/packages/studio/src/main.tsx b/packages/studio/src/main.tsx index 0ddc775d2..8cf001052 100644 --- a/packages/studio/src/main.tsx +++ b/packages/studio/src/main.tsx @@ -1,7 +1,7 @@ import React from "react"; import ReactDOM from "react-dom/client"; import { - App, + AppWithLazyLoading, hotReloadStudioData, hotReloadGitData, StudioHMRUpdateID, @@ -21,6 +21,6 @@ if (import.meta.hot) { ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( - + ); diff --git a/packages/studio/tailwind.config.ts b/packages/studio/tailwind.config.ts index 509ef7c38..df1db0951 100644 --- a/packages/studio/tailwind.config.ts +++ b/packages/studio/tailwind.config.ts @@ -50,7 +50,7 @@ export default { content: [ path.resolve(__dirname, "src/**/*.{ts,tsx}"), path.resolve(__dirname, "index.html"), - path.join(path.dirname(require.resolve("@yext/studio-ui")), "**/*.js"), + path.join(path.dirname(require.resolve("@yext/studio-ui")), "../**/*.js"), ...transformedUserContent, ], safelist: generateTailwindSafelist(userTailwindTheme),