@player-devtools/basic-plugin 0.13.1--canary.13.739 → 0.13.1--canary.16.915

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.
@@ -582,7 +582,7 @@ var BasicDevtoolsPlugin = function() {
582
582
  };
583
583
  var generateUUID = function generateUUID() {
584
584
  var d = /* @__PURE__ */ new Date().getTime();
585
- var d2 = typeof performance !== "undefined" && performance.now && performance.now() * 1e3 || 0;
585
+ var d2 = getNowTime() * 1e3;
586
586
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
587
587
  var r = Math.random() * 16;
588
588
  if (d > 0) {
@@ -1441,15 +1441,96 @@ var BasicDevtoolsPlugin = function() {
1441
1441
  playerConfig: {}
1442
1442
  }
1443
1443
  };
1444
- var PLUGIN_VERSION = true ? "0.13.1--canary.13.739" : "unstamped";
1444
+ var PLUGIN_VERSION = true ? "0.13.1--canary.16.915" : "unstamped";
1445
+ var _obj;
1445
1446
  var BasicPluginData = {
1446
1447
  id: PLUGIN_ID,
1447
1448
  name: "Standard Devtools",
1448
1449
  description: "Standard Player UI Devtools",
1449
1450
  version: PLUGIN_VERSION,
1450
- flow: flow_default
1451
+ flow: flow_default,
1452
+ capabilities: {
1453
+ description: "Exposes Player runtime state (flow, data, logs, config) and supports expression evaluation and flow overrides.",
1454
+ data: {
1455
+ flow: {
1456
+ description: "The currently active Player flow JSON"
1457
+ },
1458
+ data: {
1459
+ description: "The current Player data model"
1460
+ },
1461
+ logs: {
1462
+ description: "Accumulated log messages emitted by the Player runtime"
1463
+ },
1464
+ playerConfig: {
1465
+ description: "Player version and list of registered plugin names"
1466
+ },
1467
+ history: {
1468
+ description: "Results of previous expression evaluations in this session"
1469
+ }
1470
+ },
1471
+ actions: (_obj = {}, _define_property(_obj, INTERACTIONS.EVALUATE_EXPRESSION, {
1472
+ description: "Evaluate a Player expression string and return the result",
1473
+ params: {
1474
+ payload: {
1475
+ type: "string",
1476
+ description: "The expression to evaluate"
1477
+ }
1478
+ }
1479
+ }), _define_property(_obj, INTERACTIONS.OVERRIDE_FLOW, {
1480
+ description: "Replace the currently running flow with a new flow JSON",
1481
+ params: {
1482
+ payload: {
1483
+ type: "string",
1484
+ description: "Stringified flow JSON to load"
1485
+ }
1486
+ }
1487
+ }), _obj)
1488
+ }
1451
1489
  };
1452
1490
  // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-devtools+utils@0.0.0/node_modules/@player-devtools/utils/dist/index.mjs
1491
+ var useStateReducer = function(reducer2, initialState) {
1492
+ var state = initialState;
1493
+ var subscribers = /* @__PURE__ */ new Set();
1494
+ return {
1495
+ getState: function() {
1496
+ return state;
1497
+ },
1498
+ /** Subscribe to state changes; returns an unsubscribe function. */ subscribe: function subscribe(subscriber) {
1499
+ subscribers.add(subscriber);
1500
+ subscriber(state);
1501
+ return function() {
1502
+ return subscribers.delete(subscriber);
1503
+ };
1504
+ },
1505
+ /** Dispatch an action through the reducer, then run side-effects. */ dispatch: function dispatch(action) {
1506
+ var prevState = state;
1507
+ var nextState = reducer2(prevState, action);
1508
+ if (nextState !== prevState) {
1509
+ state = nextState;
1510
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1511
+ try {
1512
+ for(var _iterator = subscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1513
+ var sub = _step.value;
1514
+ sub(state);
1515
+ }
1516
+ } catch (err) {
1517
+ _didIteratorError = true;
1518
+ _iteratorError = err;
1519
+ } finally{
1520
+ try {
1521
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1522
+ _iterator.return();
1523
+ }
1524
+ } finally{
1525
+ if (_didIteratorError) {
1526
+ throw _iteratorError;
1527
+ }
1528
+ }
1529
+ }
1530
+ }
1531
+ }
1532
+ };
1533
+ };
1453
1534
  function deepAssign(target, source) {
1454
1535
  var merge = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
1455
1536
  if (Array.isArray(target) && Array.isArray(source)) {
@@ -1942,49 +2023,6 @@ var BasicDevtoolsPlugin = function() {
1942
2023
  return foo !== foo && bar !== bar;
1943
2024
  }
1944
2025
  // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-devtools+plugin@0.0.0/node_modules/@player-devtools/plugin/dist/index.mjs
1945
- var useStateReducer = function(reducer2, initialState) {
1946
- var state = initialState;
1947
- var subscribers = /* @__PURE__ */ new Set();
1948
- return {
1949
- getState: function() {
1950
- return state;
1951
- },
1952
- /** Subscribe to state changes; returns an unsubscribe function. */ subscribe: function subscribe(subscriber) {
1953
- subscribers.add(subscriber);
1954
- subscriber(state);
1955
- return function() {
1956
- return subscribers.delete(subscriber);
1957
- };
1958
- },
1959
- /** Dispatch an action through the reducer, then run side-effects. */ dispatch: function dispatch(action) {
1960
- var prevState = state;
1961
- var nextState = reducer2(prevState, action);
1962
- if (nextState !== prevState) {
1963
- state = nextState;
1964
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1965
- try {
1966
- for(var _iterator = subscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1967
- var sub = _step.value;
1968
- sub(state);
1969
- }
1970
- } catch (err) {
1971
- _didIteratorError = true;
1972
- _iteratorError = err;
1973
- } finally{
1974
- try {
1975
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1976
- _iterator.return();
1977
- }
1978
- } finally{
1979
- if (_didIteratorError) {
1980
- throw _iteratorError;
1981
- }
1982
- }
1983
- }
1984
- }
1985
- }
1986
- };
1987
- };
1988
2026
  var containsInteraction = function(interactions, interaction) {
1989
2027
  return interactions.filter(function(i) {
1990
2028
  return dequal(i, interaction);
@@ -2051,6 +2089,11 @@ var BasicDevtoolsPlugin = function() {
2051
2089
  PLAYER_SELECTED: "player-selected"
2052
2090
  };
2053
2091
  var PLUGIN_INACTIVE_WARNING = "The plugin has been registered, but the Player development tools are not active. If you are working in a production environment, it is recommended to remove the plugin. To activate, enable through the browser extension popup for web or configure the FlipperClient for mobile.";
2092
+ var getNowTime = globalThis.performance ? function() {
2093
+ return globalThis.performance.now();
2094
+ } : function() {
2095
+ return Date.now();
2096
+ };
2054
2097
  var NOOP_ID = -1;
2055
2098
  var genDataChangeTransaction = function(param) {
2056
2099
  var playerID = param.playerID, data = param.data, pluginID = param.pluginID;
@@ -2085,9 +2128,12 @@ var BasicDevtoolsPlugin = function() {
2085
2128
  this.lastProcessedInteraction = 0;
2086
2129
  this.store.subscribe(function(param) {
2087
2130
  var interactions = param.interactions;
2131
+ var start = _this.lastProcessedInteraction;
2088
2132
  var _interactions_length;
2089
- if (_this.lastProcessedInteraction < ((_interactions_length = interactions.length) !== null && _interactions_length !== void 0 ? _interactions_length : 0)) {
2090
- interactions.slice(_this.lastProcessedInteraction).forEach(_this.processInteraction.bind(_this));
2133
+ var end = (_interactions_length = interactions.length) !== null && _interactions_length !== void 0 ? _interactions_length : 0;
2134
+ if (start < end) {
2135
+ _this.lastProcessedInteraction = end;
2136
+ interactions.slice(start, end).forEach(_this.processInteraction.bind(_this));
2091
2137
  }
2092
2138
  });
2093
2139
  }
@@ -2222,7 +2268,6 @@ var BasicDevtoolsPlugin = function() {
2222
2268
  _messenger_: true
2223
2269
  });
2224
2270
  }
2225
- this.lastProcessedInteraction += 1;
2226
2271
  }
2227
2272
  },
2228
2273
  {
@@ -2258,12 +2303,6 @@ var BasicDevtoolsPlugin = function() {
2258
2303
  var _this = this;
2259
2304
  this.logger = new WeakRef(player.logger);
2260
2305
  if (!this.checkIfDevtoolsIsActive()) return;
2261
- this.options.pluginData.flow.data.playerConfig = {
2262
- version: player.getVersion(),
2263
- plugins: player.getPlugins().map(function(plugin) {
2264
- return plugin.name;
2265
- })
2266
- };
2267
2306
  _get(_get_prototype_of(BasicDevtoolsPlugin.prototype), "apply", this).call(this, player);
2268
2307
  this.playerConfig = {
2269
2308
  version: player.getVersion(),