@goodandready/dsh-moa 0.2.18 → 0.2.19
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/lib/client.js +26 -2
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1937,12 +1937,36 @@ window.__ModuleLoader__.load({
|
|
|
1937
1937
|
}
|
|
1938
1938
|
}
|
|
1939
1939
|
|
|
1940
|
+
// Plugin-list seat (plugins.item): the seat the current core (0.1.6-alpha.2)
|
|
1941
|
+
// renders as the plugin's own page with its configuration. It needs an id and a
|
|
1942
|
+
// static label, so it is registered on its own rather than through the keyed
|
|
1943
|
+
// helper above. The label must not read the locale: it is resolved while the
|
|
1944
|
+
// page renders, and a lookup there would take the whole client batch down.
|
|
1945
|
+
const registerItemSeat = () => {
|
|
1946
|
+
try {
|
|
1947
|
+
ctx.slots.register(
|
|
1948
|
+
{
|
|
1949
|
+
name: 'plugins.item',
|
|
1950
|
+
id: ROW_ID,
|
|
1951
|
+
order: 35,
|
|
1952
|
+
label: () => 'Mixture of Agents (MoA)',
|
|
1953
|
+
locale: NS,
|
|
1954
|
+
inject: () => ({ ctx }),
|
|
1955
|
+
},
|
|
1956
|
+
(props) => React.createElement(MoAErrorBoundary, null, React.createElement(MoACard, props))
|
|
1957
|
+
)
|
|
1958
|
+
} catch (err) {
|
|
1959
|
+
console.warn('[dsh-moa] Failed to register plugins.item:', err)
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1940
1963
|
if (typeof ctx.slots.inject === 'function') {
|
|
1941
|
-
//
|
|
1942
|
-
|
|
1964
|
+
// Plugin-list seat first, then the row seat and the legacy seat as fallbacks.
|
|
1965
|
+
ctx.slots.inject('plugins.item', registerItemSeat)
|
|
1943
1966
|
ctx.slots.inject('plugins.row.config', registerCard('plugins.row.config', ROW_CONFIG_KEY))
|
|
1944
1967
|
ctx.slots.inject('settings.plugin.item', registerCard('settings.plugin.item', NS))
|
|
1945
1968
|
} else {
|
|
1969
|
+
registerItemSeat()
|
|
1946
1970
|
registerCard('plugins.row.config', ROW_CONFIG_KEY)()
|
|
1947
1971
|
registerCard('settings.plugin.item', NS)()
|
|
1948
1972
|
}
|