@trops/dash-core 0.1.23 → 0.1.26

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/dist/index.esm.js CHANGED
@@ -26,6 +26,7 @@ import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
26
26
  import _inherits from '@babel/runtime/helpers/inherits';
27
27
  import colors from 'tailwindcss/colors';
28
28
  import * as ReactDOM from 'react-dom';
29
+ import * as dashCore from '@trops/dash-core';
29
30
  import { findIconDefinition } from '@fortawesome/fontawesome-svg-core';
30
31
  import algoliasearch from 'algoliasearch';
31
32
  import { InstantSearch, Hits } from 'react-instantsearch-hooks-web';
@@ -4303,7 +4304,7 @@ var PanelEditItem = function PanelEditItem(_ref) {
4303
4304
  name: key,
4304
4305
  selectedValue: value,
4305
4306
  onChange: function onChange(e) {
4306
- return _onChange(e, configItem);
4307
+ return _onChange(key, e.target.value);
4307
4308
  },
4308
4309
  textSize: "text-xs",
4309
4310
  className: "font-normal",
@@ -18119,7 +18120,10 @@ var ComponentManager = {
18119
18120
  var tempComponentMap = this.componentMap();
18120
18121
  // Handle both module exports (widgetConfig.default) and direct config objects
18121
18122
  var config = widgetConfig["default"] || widgetConfig;
18122
- tempComponentMap[widgetKey] = ComponentConfigModel(config);
18123
+ // Use scoped id if available (e.g., "trops.clock.AnalogClockWidget"),
18124
+ // otherwise fall back to the provided widgetKey for backward compatibility
18125
+ var registrationKey = config.id || widgetKey;
18126
+ tempComponentMap[registrationKey] = ComponentConfigModel(config);
18123
18127
  this.setComponentMap(tempComponentMap);
18124
18128
  },
18125
18129
  /**
@@ -18178,7 +18182,22 @@ var ComponentManager = {
18178
18182
  if (component && this.componentMap()) {
18179
18183
  if (ComponentManager.isLayoutContainer(component) === false) {
18180
18184
  var m = this.componentMap();
18185
+ // Try exact match first (works for both scoped ids and legacy names)
18181
18186
  var cmp = component in m ? m[component] : null;
18187
+
18188
+ // Fallback: scan by config.name for backward compatibility
18189
+ // Handles saved layouts that reference old-style names (e.g., "AnalogClockWidget")
18190
+ // when the widget is now registered under a scoped id (e.g., "trops.clock.AnalogClockWidget")
18191
+ if (cmp === null) {
18192
+ for (var _i = 0, _Object$keys = Object.keys(m); _i < _Object$keys.length; _i++) {
18193
+ var key = _Object$keys[_i];
18194
+ if (m[key].name === component) {
18195
+ cmp = m[key];
18196
+ cmp["componentName"] = key;
18197
+ return cmp;
18198
+ }
18199
+ }
18200
+ }
18182
18201
  if (cmp !== null) {
18183
18202
  cmp["componentName"] = component;
18184
18203
  return cmp;
@@ -21321,6 +21340,7 @@ var MODULE_MAP = {
21321
21340
  react: React,
21322
21341
  "react-dom": ReactDOM,
21323
21342
  "@trops/dash-react": DashReact,
21343
+ "@trops/dash-core": dashCore,
21324
21344
  "react/jsx-runtime": jsxRuntime,
21325
21345
  "prop-types": PropTypes
21326
21346
  };