@seamapi/react 4.14.2 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -3
- package/dist/ecosystem.js +45 -0
- package/dist/ecosystem.js.map +1 -0
- package/dist/elements.js +11464 -11007
- package/dist/elements.js.map +1 -1
- package/dist/index.css +469 -345
- package/dist/index.css.map +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.min.css.map +1 -1
- package/lib/seam/SeamProvider.d.ts +10 -3
- package/lib/seam/SeamProvider.js +5 -3
- package/lib/seam/SeamProvider.js.map +1 -1
- package/lib/seam/components/CompatibleApps/CompatibleApps.d.ts +26 -0
- package/lib/seam/components/CompatibleApps/CompatibleApps.js +126 -0
- package/lib/seam/components/CompatibleApps/CompatibleApps.js.map +1 -0
- package/lib/seam/components/SupportedDevices/DeviceModelRow.d.ts +8 -0
- package/lib/seam/components/SupportedDevices/DeviceModelRow.js +31 -0
- package/lib/seam/components/SupportedDevices/DeviceModelRow.js.map +1 -0
- package/lib/seam/components/SupportedDevices/FilterSelect.d.ts +12 -0
- package/lib/seam/components/SupportedDevices/FilterSelect.js +9 -0
- package/lib/seam/components/SupportedDevices/FilterSelect.js.map +1 -0
- package/lib/seam/components/SupportedDevices/ManufacturerSection.d.ts +10 -0
- package/lib/seam/components/SupportedDevices/ManufacturerSection.js +35 -0
- package/lib/seam/components/SupportedDevices/ManufacturerSection.js.map +1 -0
- package/lib/seam/components/SupportedDevices/SupportedDevices.d.ts +24 -0
- package/lib/seam/components/SupportedDevices/SupportedDevices.js +151 -0
- package/lib/seam/components/SupportedDevices/SupportedDevices.js.map +1 -0
- package/lib/seam/components/SupportedDevices/device-models.d.ts +47 -0
- package/lib/seam/components/SupportedDevices/device-models.js +217 -0
- package/lib/seam/components/SupportedDevices/device-models.js.map +1 -0
- package/lib/seam/components/index.d.ts +2 -2
- package/lib/seam/components/index.js +2 -2
- package/lib/seam/components/index.js.map +1 -1
- package/lib/seam/ecosystem/EcosystemProvider.d.ts +37 -0
- package/lib/seam/ecosystem/EcosystemProvider.js +56 -0
- package/lib/seam/ecosystem/EcosystemProvider.js.map +1 -0
- package/lib/seam/ecosystem/client.d.ts +28 -0
- package/lib/seam/ecosystem/client.js +74 -0
- package/lib/seam/ecosystem/client.js.map +1 -0
- package/lib/seam/ecosystem/index.d.ts +9 -0
- package/lib/seam/ecosystem/index.js +8 -0
- package/lib/seam/ecosystem/index.js.map +1 -0
- package/lib/seam/ecosystem/types.d.ts +253 -0
- package/lib/seam/ecosystem/types.js +10 -0
- package/lib/seam/ecosystem/types.js.map +1 -0
- package/lib/seam/ecosystem/use-compatible-partners.d.ts +21 -0
- package/lib/seam/ecosystem/use-compatible-partners.js +36 -0
- package/lib/seam/ecosystem/use-compatible-partners.js.map +1 -0
- package/lib/seam/ecosystem/use-ecosystem-device-models.d.ts +20 -0
- package/lib/seam/ecosystem/use-ecosystem-device-models.js +51 -0
- package/lib/seam/ecosystem/use-ecosystem-device-models.js.map +1 -0
- package/lib/seam/ecosystem/use-ecosystem-manufacturers.d.ts +11 -0
- package/lib/seam/ecosystem/use-ecosystem-manufacturers.js +49 -0
- package/lib/seam/ecosystem/use-ecosystem-manufacturers.js.map +1 -0
- package/lib/seam/ecosystem/use-ecosystem-query-result.d.ts +7 -0
- package/lib/seam/ecosystem/use-ecosystem-query-result.js +7 -0
- package/lib/seam/ecosystem/use-ecosystem-query-result.js.map +1 -0
- package/lib/seam/ecosystem/use-embed-key-resolution.d.ts +20 -0
- package/lib/seam/ecosystem/use-embed-key-resolution.js +51 -0
- package/lib/seam/ecosystem/use-embed-key-resolution.js.map +1 -0
- package/lib/seam/index.d.ts +1 -0
- package/lib/seam/index.js +1 -0
- package/lib/seam/index.js.map +1 -1
- package/lib/seam/seam-components-class-name.d.ts +1 -0
- package/lib/seam/seam-components-class-name.js +2 -0
- package/lib/seam/seam-components-class-name.js.map +1 -0
- package/lib/ui/ecosystem/SearchField.d.ts +9 -0
- package/lib/ui/ecosystem/SearchField.js +8 -0
- package/lib/ui/ecosystem/SearchField.js.map +1 -0
- package/lib/ui/ecosystem/StateMessage.d.ts +8 -0
- package/lib/ui/ecosystem/StateMessage.js +5 -0
- package/lib/ui/ecosystem/StateMessage.js.map +1 -0
- package/lib/ui/ecosystem/errors.d.ts +5 -0
- package/lib/ui/ecosystem/errors.js +25 -0
- package/lib/ui/ecosystem/errors.js.map +1 -0
- package/lib/ui/ecosystem/storybook.d.ts +15 -0
- package/lib/ui/ecosystem/storybook.js +16 -0
- package/lib/ui/ecosystem/storybook.js.map +1 -0
- package/lib/ui/ecosystem/theme.d.ts +6 -0
- package/lib/ui/ecosystem/theme.js +11 -0
- package/lib/ui/ecosystem/theme.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +11 -3
- package/src/ecosystem.d.ts +2 -0
- package/src/ecosystem.ts +12 -0
- package/src/elements.ts +4 -0
- package/src/lib/ecosystem-element.tsx +154 -0
- package/src/lib/element.tsx +6 -0
- package/src/lib/seam/SeamProvider.tsx +18 -2
- package/src/lib/seam/components/CompatibleApps/CompatibleApps.element.ts +19 -0
- package/src/lib/seam/components/CompatibleApps/CompatibleApps.tsx +344 -0
- package/src/lib/seam/components/SupportedDevices/DeviceModelRow.tsx +105 -0
- package/src/lib/seam/components/SupportedDevices/FilterSelect.tsx +43 -0
- package/src/lib/seam/components/SupportedDevices/ManufacturerSection.tsx +114 -0
- package/src/lib/seam/components/SupportedDevices/SupportedDevices.element.ts +17 -0
- package/src/lib/seam/components/SupportedDevices/SupportedDevices.tsx +382 -0
- package/src/lib/seam/components/SupportedDevices/device-models.ts +326 -0
- package/src/lib/seam/components/ecosystem-elements.ts +2 -0
- package/src/lib/seam/components/elements.ts +0 -2
- package/src/lib/seam/components/index.ts +2 -2
- package/src/lib/seam/ecosystem/EcosystemProvider.tsx +133 -0
- package/src/lib/seam/ecosystem/client.ts +116 -0
- package/src/lib/seam/ecosystem/index.ts +19 -0
- package/src/lib/seam/ecosystem/types.ts +334 -0
- package/src/lib/seam/ecosystem/use-compatible-partners.ts +80 -0
- package/src/lib/seam/ecosystem/use-ecosystem-device-models.ts +96 -0
- package/src/lib/seam/ecosystem/use-ecosystem-manufacturers.ts +86 -0
- package/src/lib/seam/ecosystem/use-ecosystem-query-result.ts +19 -0
- package/src/lib/seam/ecosystem/use-embed-key-resolution.ts +80 -0
- package/src/lib/seam/index.ts +1 -0
- package/src/lib/seam/seam-components-class-name.ts +1 -0
- package/src/lib/ui/ecosystem/SearchField.tsx +32 -0
- package/src/lib/ui/ecosystem/StateMessage.tsx +29 -0
- package/src/lib/ui/ecosystem/errors.ts +30 -0
- package/src/lib/ui/ecosystem/storybook.tsx +40 -0
- package/src/lib/ui/ecosystem/theme.ts +14 -0
- package/src/lib/version.ts +1 -1
- package/src/styles/_compatible-apps.scss +102 -0
- package/src/styles/_ecosystem.scss +295 -0
- package/src/styles/_main.scss +6 -4
- package/src/styles/_supported-devices.scss +153 -0
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +0 -20
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js +0 -22
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.d.ts +0 -6
- package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.js +0 -8
- package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.d.ts +0 -9
- package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.js +0 -14
- package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +0 -13
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +0 -58
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.d.ts +0 -7
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js +0 -6
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +0 -12
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js +0 -58
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.d.ts +0 -8
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js +0 -39
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +0 -10
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js +0 -35
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +0 -11
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +0 -20
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.d.ts +0 -6
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js +0 -21
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-device-model.d.ts +0 -7
- package/lib/seam/components/SupportedDeviceTable/use-device-model.js +0 -21
- package/lib/seam/components/SupportedDeviceTable/use-device-model.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-device-models.d.ts +0 -7
- package/lib/seam/components/SupportedDeviceTable/use-device-models.js +0 -30
- package/lib/seam/components/SupportedDeviceTable/use-device-models.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +0 -15
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +0 -45
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.d.ts +0 -10
- package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js +0 -42
- package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.d.ts +0 -7
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js +0 -17
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.d.ts +0 -7
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js +0 -26
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js.map +0 -1
- package/src/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.tsx +0 -78
- package/src/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.tsx +0 -13
- package/src/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.tsx +0 -32
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +0 -161
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx +0 -22
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +0 -145
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.tsx +0 -109
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx +0 -93
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.element.ts +0 -15
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +0 -70
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.element.ts +0 -9
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.tsx +0 -64
- package/src/lib/seam/components/SupportedDeviceTable/use-device-model.ts +0 -44
- package/src/lib/seam/components/SupportedDeviceTable/use-device-models.ts +0 -57
- package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +0 -88
- package/src/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.ts +0 -69
- package/src/lib/seam/components/SupportedDeviceTable/use-manufacturer.ts +0 -40
- package/src/lib/seam/components/SupportedDeviceTable/use-manufacturers.ts +0 -53
- package/src/styles/_supported-device-table-manufacturer-keys.scss +0 -20
- package/src/styles/_supported-device-table.scss +0 -412
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/** Capabilities shown as badges, in display order. */
|
|
2
|
+
export const capabilityLabels = {
|
|
3
|
+
can_remotely_unlock: 'Remote unlock',
|
|
4
|
+
can_remotely_lock: 'Remote lock',
|
|
5
|
+
can_program_online_access_codes: 'Access codes',
|
|
6
|
+
can_program_offline_access_codes: 'Offline access codes',
|
|
7
|
+
can_provision_mobile_keys: 'Mobile keys',
|
|
8
|
+
can_provision_wallet_keys: 'Wallet keys',
|
|
9
|
+
can_encode_plastic_cards: 'Key cards',
|
|
10
|
+
can_hvac_heat: 'Heat',
|
|
11
|
+
can_hvac_cool: 'Cool',
|
|
12
|
+
can_hvac_auto: 'Heat and cool',
|
|
13
|
+
can_hvac_fan: 'Fan',
|
|
14
|
+
can_program_thermostat_weekly_programs: 'Weekly programs',
|
|
15
|
+
can_monitor: 'Monitoring',
|
|
16
|
+
};
|
|
17
|
+
const capabilityOrder = Object.keys(capabilityLabels);
|
|
18
|
+
export const getCapabilityLabel = (name) => capabilityLabels[name] ??
|
|
19
|
+
name.replace(/^can_/, '').replaceAll('_', ' ');
|
|
20
|
+
/**
|
|
21
|
+
* Removes what a partner's embed key says its widgets must not show
|
|
22
|
+
* (Ecosystem `embed/resolve`): excluded manufacturers and device types,
|
|
23
|
+
* unsupported providers, and the provider combinations excluded for the
|
|
24
|
+
* resolved capability. A model left with no provider is removed.
|
|
25
|
+
*/
|
|
26
|
+
export const applyEmbedExclusions = (deviceModels, exclusions) => {
|
|
27
|
+
if (exclusions == null)
|
|
28
|
+
return deviceModels;
|
|
29
|
+
const excludedManufacturers = new Set(exclusions.excluded_manufacturers);
|
|
30
|
+
const excludedDeviceTypes = new Set(exclusions.excluded_device_types);
|
|
31
|
+
const unsupportedProviders = new Set(exclusions.unsupported_providers);
|
|
32
|
+
const { capability } = exclusions;
|
|
33
|
+
const result = [];
|
|
34
|
+
for (const deviceModel of deviceModels) {
|
|
35
|
+
const manufacturerSlug = deviceModel.manufacturer?.slug ?? '';
|
|
36
|
+
const deviceTypeSlug = deviceModel.device_type?.slug ?? '';
|
|
37
|
+
if (excludedManufacturers.has(manufacturerSlug))
|
|
38
|
+
continue;
|
|
39
|
+
if (excludedDeviceTypes.has(deviceTypeSlug))
|
|
40
|
+
continue;
|
|
41
|
+
const capabilityExclusions = exclusions.capability_exclusions.filter((exclusion) => capability.length > 0 &&
|
|
42
|
+
exclusion.device_category === deviceTypeSlug &&
|
|
43
|
+
(exclusion.manufacturer_slug === '' ||
|
|
44
|
+
exclusion.manufacturer_slug === manufacturerSlug));
|
|
45
|
+
if (capabilityExclusions.some((e) => e.provider_slug === ''))
|
|
46
|
+
continue;
|
|
47
|
+
const capabilityExcludedProviders = new Set(capabilityExclusions.map((e) => e.provider_slug));
|
|
48
|
+
const providers = deviceModel.providers.filter((provider) => !unsupportedProviders.has(provider.slug));
|
|
49
|
+
if (deviceModel.providers.length > 0 && providers.length === 0)
|
|
50
|
+
continue;
|
|
51
|
+
const capabilitiesByProvider = deviceModel.capabilities_by_provider
|
|
52
|
+
.filter(({ provider }) => !unsupportedProviders.has(provider.slug))
|
|
53
|
+
.map((entry) => capabilityExcludedProviders.has(entry.provider.slug)
|
|
54
|
+
? {
|
|
55
|
+
...entry,
|
|
56
|
+
capabilities: entry.capabilities.filter((c) => c.name !== capability),
|
|
57
|
+
}
|
|
58
|
+
: entry);
|
|
59
|
+
result.push({
|
|
60
|
+
...deviceModel,
|
|
61
|
+
providers,
|
|
62
|
+
capabilities_by_provider: capabilitiesByProvider,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
};
|
|
67
|
+
/** The best support for each capability across the model's providers. */
|
|
68
|
+
export const getSupportedCapabilities = (deviceModel) => {
|
|
69
|
+
const best = new Map();
|
|
70
|
+
for (const { capabilities } of deviceModel.capabilities_by_provider) {
|
|
71
|
+
for (const capability of capabilities) {
|
|
72
|
+
const supported = toSupported(capability);
|
|
73
|
+
if (supported == null)
|
|
74
|
+
continue;
|
|
75
|
+
const current = best.get(capability.name);
|
|
76
|
+
if (current?.supported === 'yes')
|
|
77
|
+
continue;
|
|
78
|
+
best.set(capability.name, {
|
|
79
|
+
name: capability.name,
|
|
80
|
+
supported,
|
|
81
|
+
details: capability.report?.details ?? null,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return [...best.values()].sort((a, b) => capabilityRank(a.name) - capabilityRank(b.name));
|
|
86
|
+
};
|
|
87
|
+
export const supportsCapability = (deviceModel, capability) => getSupportedCapabilities(deviceModel).some((c) => c.name === capability);
|
|
88
|
+
export const filterDeviceModels = (deviceModels, { manufacturer, deviceType, capability, search = '' }) => {
|
|
89
|
+
const terms = search.toLowerCase().trim().split(/\s+/).filter(Boolean);
|
|
90
|
+
return deviceModels.filter((deviceModel) => {
|
|
91
|
+
if (manufacturer != null && deviceModel.manufacturer?.slug !== manufacturer)
|
|
92
|
+
return false;
|
|
93
|
+
if (deviceType != null && deviceModel.device_type?.slug !== deviceType)
|
|
94
|
+
return false;
|
|
95
|
+
if (capability != null && !supportsCapability(deviceModel, capability))
|
|
96
|
+
return false;
|
|
97
|
+
if (terms.length === 0)
|
|
98
|
+
return true;
|
|
99
|
+
const haystack = getSearchText(deviceModel);
|
|
100
|
+
return terms.every((term) => haystack.includes(term));
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
const getSearchText = (deviceModel) => [
|
|
104
|
+
deviceModel.display_name,
|
|
105
|
+
deviceModel.slug,
|
|
106
|
+
deviceModel.manufacturer?.display_name,
|
|
107
|
+
deviceModel.device_type?.display_name,
|
|
108
|
+
...deviceModel.providers.map((p) => p.display_name),
|
|
109
|
+
...deviceModel.variants.map((v) => v.manufacturer_model_id),
|
|
110
|
+
]
|
|
111
|
+
.filter((value) => value != null)
|
|
112
|
+
.join(' ')
|
|
113
|
+
.toLowerCase();
|
|
114
|
+
export const groupDeviceModelsByManufacturer = (deviceModels) => {
|
|
115
|
+
const groups = new Map();
|
|
116
|
+
for (const deviceModel of deviceModels) {
|
|
117
|
+
const key = deviceModel.manufacturer?.slug ?? '';
|
|
118
|
+
const group = groups.get(key) ?? {
|
|
119
|
+
key,
|
|
120
|
+
manufacturer: deviceModel.manufacturer,
|
|
121
|
+
deviceModels: [],
|
|
122
|
+
};
|
|
123
|
+
group.deviceModels.push(deviceModel);
|
|
124
|
+
groups.set(key, group);
|
|
125
|
+
}
|
|
126
|
+
for (const group of groups.values()) {
|
|
127
|
+
group.deviceModels.sort((a, b) => getDeviceModelName(a).localeCompare(getDeviceModelName(b)));
|
|
128
|
+
}
|
|
129
|
+
return [...groups.values()].sort((a, b) => {
|
|
130
|
+
if (a.manufacturer == null)
|
|
131
|
+
return 1;
|
|
132
|
+
if (b.manufacturer == null)
|
|
133
|
+
return -1;
|
|
134
|
+
return getManufacturerName(a.manufacturer).localeCompare(getManufacturerName(b.manufacturer));
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
export const getManufacturerOptions = (deviceModels) => uniqueOptions(deviceModels.map((m) => m.manufacturer == null
|
|
138
|
+
? null
|
|
139
|
+
: {
|
|
140
|
+
value: m.manufacturer.slug,
|
|
141
|
+
label: getManufacturerName(m.manufacturer),
|
|
142
|
+
}));
|
|
143
|
+
export const getDeviceTypeOptions = (deviceModels) => uniqueOptions(deviceModels.map((m) => m.device_type == null
|
|
144
|
+
? null
|
|
145
|
+
: { value: m.device_type.slug, label: m.device_type.display_name }));
|
|
146
|
+
export const getCapabilityOptions = (deviceModels) => {
|
|
147
|
+
const names = new Set();
|
|
148
|
+
for (const deviceModel of deviceModels) {
|
|
149
|
+
for (const { name } of getSupportedCapabilities(deviceModel)) {
|
|
150
|
+
if (capabilityLabels[name] != null)
|
|
151
|
+
names.add(name);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return [...names]
|
|
155
|
+
.sort((a, b) => capabilityRank(a) - capabilityRank(b))
|
|
156
|
+
.map((name) => ({ value: name, label: getCapabilityLabel(name) }));
|
|
157
|
+
};
|
|
158
|
+
export const getDeviceModelName = (deviceModel) => deviceModel.display_name ?? deviceModel.slug;
|
|
159
|
+
export const getManufacturerName = (manufacturer) => manufacturer.display_name ?? manufacturer.slug;
|
|
160
|
+
/** The best available image URL for a device model. */
|
|
161
|
+
export const getDeviceModelImageUrl = (deviceModel, manufacturer) => {
|
|
162
|
+
const image = deviceModel.featured_image ??
|
|
163
|
+
deviceModel.variants.flatMap((variant) => variant.images)[0] ??
|
|
164
|
+
manufacturer?.default_device_images.find((d) => d.device_type.slug === deviceModel.device_type?.slug)?.asset ??
|
|
165
|
+
null;
|
|
166
|
+
if (image == null)
|
|
167
|
+
return null;
|
|
168
|
+
return (image.formats.thumbnail?.url ??
|
|
169
|
+
image.formats.small?.url ??
|
|
170
|
+
image.formats.medium?.url ??
|
|
171
|
+
image.url);
|
|
172
|
+
};
|
|
173
|
+
/** The manufacturer's logo, preferring a square logo. */
|
|
174
|
+
export const getManufacturerLogoUrl = (manufacturer, { mono = false } = {}) => {
|
|
175
|
+
if (manufacturer == null)
|
|
176
|
+
return null;
|
|
177
|
+
const kinds = mono
|
|
178
|
+
? [
|
|
179
|
+
'square_logo_mono',
|
|
180
|
+
'horizontal_logo_mono',
|
|
181
|
+
'square_logo',
|
|
182
|
+
'horizontal_logo',
|
|
183
|
+
]
|
|
184
|
+
: [
|
|
185
|
+
'square_logo',
|
|
186
|
+
'horizontal_logo',
|
|
187
|
+
'square_logo_mono',
|
|
188
|
+
'horizontal_logo_mono',
|
|
189
|
+
];
|
|
190
|
+
for (const kind of kinds) {
|
|
191
|
+
const logo = manufacturer.logos.find((l) => l.kind === kind);
|
|
192
|
+
if (logo != null)
|
|
193
|
+
return logo.formats.small?.url ?? logo.url;
|
|
194
|
+
}
|
|
195
|
+
return null;
|
|
196
|
+
};
|
|
197
|
+
const toSupported = (capability) => {
|
|
198
|
+
if (capability.supported === 'yes')
|
|
199
|
+
return 'yes';
|
|
200
|
+
if (capability.supported === 'conditionally')
|
|
201
|
+
return 'conditionally';
|
|
202
|
+
return null;
|
|
203
|
+
};
|
|
204
|
+
const capabilityRank = (name) => {
|
|
205
|
+
const index = capabilityOrder.indexOf(name);
|
|
206
|
+
return index === -1 ? capabilityOrder.length : index;
|
|
207
|
+
};
|
|
208
|
+
const uniqueOptions = (options) => {
|
|
209
|
+
const byValue = new Map();
|
|
210
|
+
for (const option of options) {
|
|
211
|
+
if (option != null && !byValue.has(option.value)) {
|
|
212
|
+
byValue.set(option.value, option);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return [...byValue.values()].sort((a, b) => a.label.localeCompare(b.label));
|
|
216
|
+
};
|
|
217
|
+
//# sourceMappingURL=device-models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-models.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDevices/device-models.ts"],"names":[],"mappings":"AAiCA,sDAAsD;AACtD,MAAM,CAAC,MAAM,gBAAgB,GAA4C;IACvE,mBAAmB,EAAE,eAAe;IACpC,iBAAiB,EAAE,aAAa;IAChC,+BAA+B,EAAE,cAAc;IAC/C,gCAAgC,EAAE,sBAAsB;IACxD,yBAAyB,EAAE,aAAa;IACxC,yBAAyB,EAAE,aAAa;IACxC,wBAAwB,EAAE,WAAW;IACrC,aAAa,EAAE,MAAM;IACrB,a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,CAAA;IAC/C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACnC,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;AAC7E,CAAC,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from './AccessCodeDetails/AccessCodeDetails.js';
|
|
2
2
|
export * from './AccessCodeTable/AccessCodeTable.js';
|
|
3
3
|
export * from './common-props.js';
|
|
4
|
+
export * from './CompatibleApps/CompatibleApps.js';
|
|
4
5
|
export * from './ConnectAccountButton/ConnectAccountButton.js';
|
|
5
6
|
export * from './CreateAccessCodeForm/CreateAccessCodeForm.js';
|
|
6
7
|
export * from './DeviceDetails/DeviceDetails.js';
|
|
7
8
|
export * from './DeviceTable/DeviceTable.js';
|
|
8
9
|
export * from './EditAccessCodeForm/EditAccessCodeForm.js';
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js';
|
|
10
|
+
export * from './SupportedDevices/SupportedDevices.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export * from './AccessCodeDetails/AccessCodeDetails.js';
|
|
2
2
|
export * from './AccessCodeTable/AccessCodeTable.js';
|
|
3
3
|
export * from './common-props.js';
|
|
4
|
+
export * from './CompatibleApps/CompatibleApps.js';
|
|
4
5
|
export * from './ConnectAccountButton/ConnectAccountButton.js';
|
|
5
6
|
export * from './CreateAccessCodeForm/CreateAccessCodeForm.js';
|
|
6
7
|
export * from './DeviceDetails/DeviceDetails.js';
|
|
7
8
|
export * from './DeviceTable/DeviceTable.js';
|
|
8
9
|
export * from './EditAccessCodeForm/EditAccessCodeForm.js';
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js';
|
|
10
|
+
export * from './SupportedDevices/SupportedDevices.js';
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/seam/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAA;AACxD,cAAc,sCAAsC,CAAA;AACpD,cAAc,mBAAmB,CAAA;AACjC,cAAc,gDAAgD,CAAA;AAC9D,cAAc,gDAAgD,CAAA;AAC9D,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4CAA4C,CAAA;AAC1D,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/seam/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAA;AACxD,cAAc,sCAAsC,CAAA;AACpD,cAAc,mBAAmB,CAAA;AACjC,cAAc,oCAAoC,CAAA;AAClD,cAAc,gDAAgD,CAAA;AAC9D,cAAc,gDAAgD,CAAA;AAC9D,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4CAA4C,CAAA;AAC1D,cAAc,wCAAwC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { type PropsWithChildren } from 'react';
|
|
3
|
+
export interface EcosystemContext {
|
|
4
|
+
/** The embed key sent as `X-Embed-Key`, if any. */
|
|
5
|
+
embedKey: string | undefined;
|
|
6
|
+
/** The Ecosystem API endpoint, ending in `/`. */
|
|
7
|
+
endpoint: string;
|
|
8
|
+
}
|
|
9
|
+
export interface EcosystemOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Seam Ecosystem embed key (`eco_live_…`).
|
|
12
|
+
* Required outside seam.co: the key's allowed origins must include the page origin.
|
|
13
|
+
*/
|
|
14
|
+
embedKey?: string | undefined;
|
|
15
|
+
/** Seam Ecosystem API endpoint. Defaults to `https://ecosystem.seam.co/v1/`. */
|
|
16
|
+
ecosystemEndpoint?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface EcosystemProviderProps extends EcosystemOptions, PropsWithChildren {
|
|
19
|
+
queryClient?: QueryClient | undefined;
|
|
20
|
+
disableCssInjection?: boolean | undefined;
|
|
21
|
+
disableFontInjection?: boolean | undefined;
|
|
22
|
+
unminifiyCss?: boolean | undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Provides the Seam Ecosystem context for `CompatibleApps` and `SupportedDevices`.
|
|
26
|
+
*
|
|
27
|
+
* Unlike `SeamProvider`, this does not need a Seam publishable key
|
|
28
|
+
* and does not load the Seam API client, so it stays lightweight.
|
|
29
|
+
* Inside a `SeamProvider`, pass `embedKey` to the `SeamProvider` instead.
|
|
30
|
+
*/
|
|
31
|
+
export declare function EcosystemProvider({ children, queryClient, disableCssInjection, disableFontInjection, unminifiyCss, ...options }: EcosystemProviderProps): JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Provides only the Ecosystem context; used by `SeamProvider`.
|
|
34
|
+
* Unset options inherit from an enclosing provider.
|
|
35
|
+
*/
|
|
36
|
+
export declare function EcosystemContextProvider({ children, embedKey, ecosystemEndpoint, }: EcosystemOptions & PropsWithChildren): JSX.Element;
|
|
37
|
+
export declare function useEcosystemContext(): EcosystemContext;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { QueryClient, QueryClientContext, QueryClientProvider, } from '@tanstack/react-query';
|
|
3
|
+
import { createContext, useContext, useMemo, } from 'react';
|
|
4
|
+
import { defaultEcosystemEndpoint } from '../../../lib/seam/ecosystem/client.js';
|
|
5
|
+
import { seamComponentsClassName } from '../../../lib/seam/seam-components-class-name.js';
|
|
6
|
+
import { useSeamFont } from '../../../lib/seam/use-seam-font.js';
|
|
7
|
+
import { useSeamStyles } from '../../../lib/seam/use-seam-styles.js';
|
|
8
|
+
const defaultQueryClient = new QueryClient();
|
|
9
|
+
/**
|
|
10
|
+
* Provides the Seam Ecosystem context for `CompatibleApps` and `SupportedDevices`.
|
|
11
|
+
*
|
|
12
|
+
* Unlike `SeamProvider`, this does not need a Seam publishable key
|
|
13
|
+
* and does not load the Seam API client, so it stays lightweight.
|
|
14
|
+
* Inside a `SeamProvider`, pass `embedKey` to the `SeamProvider` instead.
|
|
15
|
+
*/
|
|
16
|
+
export function EcosystemProvider({ children, queryClient, disableCssInjection = false, disableFontInjection = false, unminifiyCss = false, ...options }) {
|
|
17
|
+
useSeamStyles({ disabled: disableCssInjection, unminified: unminifiyCss });
|
|
18
|
+
useSeamFont({ disabled: disableFontInjection });
|
|
19
|
+
const queryClientFromContext = useContext(QueryClientContext);
|
|
20
|
+
return (_jsx("div", { className: seamComponentsClassName, children: _jsx(QueryClientProvider, { client: queryClient ??
|
|
21
|
+
queryClientFromContext ??
|
|
22
|
+
globalThis.seamQueryClient ??
|
|
23
|
+
defaultQueryClient, children: _jsx(EcosystemContextProvider, { ...options, children: children }) }) }));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Provides only the Ecosystem context; used by `SeamProvider`.
|
|
27
|
+
* Unset options inherit from an enclosing provider.
|
|
28
|
+
*/
|
|
29
|
+
export function EcosystemContextProvider({ children, embedKey, ecosystemEndpoint, }) {
|
|
30
|
+
const parent = useContext(ecosystemContext);
|
|
31
|
+
const value = useMemo(() => ({
|
|
32
|
+
embedKey: normalizeEmbedKey(embedKey) ?? parent.embedKey,
|
|
33
|
+
endpoint: normalizeEndpoint(ecosystemEndpoint) ?? parent.endpoint,
|
|
34
|
+
}), [embedKey, ecosystemEndpoint, parent]);
|
|
35
|
+
return (_jsx(ecosystemContext.Provider, { value: value, children: children }));
|
|
36
|
+
}
|
|
37
|
+
export function useEcosystemContext() {
|
|
38
|
+
return useContext(ecosystemContext);
|
|
39
|
+
}
|
|
40
|
+
const normalizeEmbedKey = (embedKey) => {
|
|
41
|
+
const key = embedKey?.trim();
|
|
42
|
+
if (key == null || key.length === 0)
|
|
43
|
+
return undefined;
|
|
44
|
+
return key;
|
|
45
|
+
};
|
|
46
|
+
const normalizeEndpoint = (endpoint) => {
|
|
47
|
+
const value = endpoint?.trim();
|
|
48
|
+
if (value == null || value.length === 0)
|
|
49
|
+
return undefined;
|
|
50
|
+
return value.endsWith('/') ? value : `${value}/`;
|
|
51
|
+
};
|
|
52
|
+
const ecosystemContext = createContext({
|
|
53
|
+
embedKey: undefined,
|
|
54
|
+
endpoint: defaultEcosystemEndpoint,
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=EcosystemProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EcosystemProvider.js","sourceRoot":"","sources":["../../../src/lib/seam/ecosystem/EcosystemProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,aAAa,EAEb,UAAU,EACV,OAAO,GACR,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AA4B3D,MAAM,kBAAkB,GAAG,IAAI,WAAW,EAAE,CAAA;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,QAAQ,EACR,WAAW,EACX,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QAAQ,EAAE,IAAI,EAAE,CAAA;IAC5B,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IACrD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,CACxB,QAA4B,EACR,EAAE;IACtB,MAAM,KAAK,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAA;IAC9B,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IACzD,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAA;AAClD,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG,aAAa,CAAmB;IACvD,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,wBAAwB;CACnC,CAAC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const defaultEcosystemEndpoint = "https://ecosystem.seam.co/v1/";
|
|
2
|
+
export type EcosystemQueryParams = Record<string, string | number | boolean | string[] | null | undefined>;
|
|
3
|
+
export interface EcosystemRequestOptions {
|
|
4
|
+
endpoint: string;
|
|
5
|
+
embedKey?: string | undefined;
|
|
6
|
+
params?: EcosystemQueryParams;
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* An error response from the Ecosystem API.
|
|
11
|
+
* The `type` is the API error type, e.g., `embed_key_required`,
|
|
12
|
+
* `invalid_embed_key` or `origin_not_allowed`.
|
|
13
|
+
*/
|
|
14
|
+
export declare class EcosystemApiError extends Error {
|
|
15
|
+
readonly status: number;
|
|
16
|
+
readonly type: string;
|
|
17
|
+
readonly requestId: string | null;
|
|
18
|
+
constructor({ status, type, message, requestId, }: {
|
|
19
|
+
status: number;
|
|
20
|
+
type: string;
|
|
21
|
+
message: string;
|
|
22
|
+
requestId?: string | null;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** True when the error means the embed key is missing, invalid or not allowed here. */
|
|
26
|
+
export declare const isEmbedKeyError: (error: unknown) => boolean;
|
|
27
|
+
export declare const getEcosystemUrl: (endpoint: string, path: string, params?: EcosystemQueryParams) => URL;
|
|
28
|
+
export declare const fetchEcosystem: <T>(path: string, { endpoint, embedKey, params, signal }: EcosystemRequestOptions) => Promise<T>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export const defaultEcosystemEndpoint = 'https://ecosystem.seam.co/v1/';
|
|
2
|
+
/**
|
|
3
|
+
* An error response from the Ecosystem API.
|
|
4
|
+
* The `type` is the API error type, e.g., `embed_key_required`,
|
|
5
|
+
* `invalid_embed_key` or `origin_not_allowed`.
|
|
6
|
+
*/
|
|
7
|
+
export class EcosystemApiError extends Error {
|
|
8
|
+
status;
|
|
9
|
+
type;
|
|
10
|
+
requestId;
|
|
11
|
+
constructor({ status, type, message, requestId = null, }) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = 'EcosystemApiError';
|
|
14
|
+
this.status = status;
|
|
15
|
+
this.type = type;
|
|
16
|
+
this.requestId = requestId;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** True when the error means the embed key is missing, invalid or not allowed here. */
|
|
20
|
+
export const isEmbedKeyError = (error) => error instanceof EcosystemApiError &&
|
|
21
|
+
(error.status === 401 || error.status === 403);
|
|
22
|
+
export const getEcosystemUrl = (endpoint, path, params = {}) => {
|
|
23
|
+
const base = endpoint.endsWith('/') ? endpoint : `${endpoint}/`;
|
|
24
|
+
const url = new URL(path, new URL(base, globalThis.location?.href));
|
|
25
|
+
for (const [key, value] of Object.entries(params)) {
|
|
26
|
+
if (value == null)
|
|
27
|
+
continue;
|
|
28
|
+
if (Array.isArray(value)) {
|
|
29
|
+
if (value.length === 0)
|
|
30
|
+
continue;
|
|
31
|
+
url.searchParams.set(key, value.join(','));
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (typeof value === 'string' && value.length === 0)
|
|
35
|
+
continue;
|
|
36
|
+
url.searchParams.set(key, String(value));
|
|
37
|
+
}
|
|
38
|
+
return url;
|
|
39
|
+
};
|
|
40
|
+
export const fetchEcosystem = async (path, { endpoint, embedKey, params, signal }) => {
|
|
41
|
+
const url = getEcosystemUrl(endpoint, path, params);
|
|
42
|
+
const headers = { Accept: 'application/json' };
|
|
43
|
+
if (embedKey != null && embedKey.length > 0) {
|
|
44
|
+
headers['X-Embed-Key'] = embedKey;
|
|
45
|
+
}
|
|
46
|
+
const res = await globalThis.fetch(url, {
|
|
47
|
+
headers,
|
|
48
|
+
...(signal == null ? {} : { signal }),
|
|
49
|
+
});
|
|
50
|
+
const body = (await res.json().catch(() => null));
|
|
51
|
+
if (!res.ok) {
|
|
52
|
+
const error = isErrorResponse(body) ? body.error : null;
|
|
53
|
+
throw new EcosystemApiError({
|
|
54
|
+
status: res.status,
|
|
55
|
+
type: error?.type ?? 'unknown_error',
|
|
56
|
+
message: error?.message ?? `Ecosystem request failed with status ${res.status}`,
|
|
57
|
+
requestId: error?.request_id ?? null,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (body == null || typeof body !== 'object') {
|
|
61
|
+
throw new EcosystemApiError({
|
|
62
|
+
status: res.status,
|
|
63
|
+
type: 'invalid_response',
|
|
64
|
+
message: 'Ecosystem returned an invalid response',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return body;
|
|
68
|
+
};
|
|
69
|
+
const isErrorResponse = (body) => body != null &&
|
|
70
|
+
typeof body === 'object' &&
|
|
71
|
+
'error' in body &&
|
|
72
|
+
body.error != null &&
|
|
73
|
+
typeof body.error === 'object';
|
|
74
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/lib/seam/ecosystem/client.ts"],"names":[],"mappings":"AAE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AAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;QACvD,MAAM,IAAI,iBAAiB,CAAC;YAC1B,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,IAAI,EAAE,KAAK,EAAE,IAAI,IAAI,eAAe;YACpC,OAAO,EACL,KAAK,EAAE,OAAO,IAAI,wCAAwC,GAAG,CAAC,MAAM,EAAE;YACxE,SAAS,EAAE,KAAK,EAAE,UAAU,IAAI,IAAI;SACrC,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7C,MAAM,IAAI,iBAAiB,CAAC;YAC1B,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,IAAI,EAAE,kBAAkB;YACxB,OAAO,EAAE,wCAAwC;SAClD,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,IAAS,CAAA;AAClB,CAAC,CAAA;AAED,MAAM,eAAe,GAAG,CAAC,IAAa,EAAkC,EAAE,CACxE,IAAI,IAAI,IAAI;IACZ,OAAO,IAAI,KAAK,QAAQ;IACxB,OAAO,IAAI,IAAI;IACf,IAAI,CAAC,KAAK,IAAI,IAAI;IAClB,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { defaultEcosystemEndpoint, EcosystemApiError, isEmbedKeyError, } from './client.js';
|
|
2
|
+
export { type EcosystemContext, type EcosystemOptions, EcosystemProvider, type EcosystemProviderProps, useEcosystemContext, } from './EcosystemProvider.js';
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export * from './use-compatible-partners.js';
|
|
5
|
+
export * from './use-ecosystem-device-models.js';
|
|
6
|
+
export * from './use-ecosystem-manufacturers.js';
|
|
7
|
+
export type { UseEcosystemQueryResult } from './use-ecosystem-query-result.js';
|
|
8
|
+
export * from './use-embed-key-resolution.js';
|
|
9
|
+
export type { EcosystemTheme } from '../../../lib/ui/ecosystem/theme.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { defaultEcosystemEndpoint, EcosystemApiError, isEmbedKeyError, } from './client.js';
|
|
2
|
+
export { EcosystemProvider, useEcosystemContext, } from './EcosystemProvider.js';
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export * from './use-compatible-partners.js';
|
|
5
|
+
export * from './use-ecosystem-device-models.js';
|
|
6
|
+
export * from './use-ecosystem-manufacturers.js';
|
|
7
|
+
export * from './use-embed-key-resolution.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/seam/ecosystem/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,GAChB,MAAM,aAAa,CAAA;AACpB,OAAO,EAGL,iBAAiB,EAEjB,mBAAmB,GACpB,MAAM,wBAAwB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA;AAEhD,cAAc,+BAA+B,CAAA"}
|