@xstate/inspect
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -0,0 +0,0 @@ import { Interpreter } from 'xstate'; |
@@ -1,16 +0,7 @@ | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
import { __assign } from './_virtual/_tslib.js'; | ||
import { createMachine, assign, interpret } from 'xstate'; | ||
import { toSCXMLEvent, toEventObject } from 'xstate/lib/utils'; | ||
var serviceMap = new Map(); | ||
export function createDevTools() { | ||
function createDevTools() { | ||
var services = new Set(); | ||
@@ -44,3 +35,3 @@ var serviceListeners = new Set(); | ||
} | ||
export var inspectMachine = createMachine({ | ||
var inspectMachine = createMachine({ | ||
initial: 'pendingConnection', | ||
@@ -106,3 +97,3 @@ context: { | ||
}; | ||
export function inspect(options) { | ||
function inspect(options) { | ||
createDevTools(); | ||
@@ -196,1 +187,3 @@ var _a = __assign(__assign({}, defaultInspectorOptions), options), iframe = _a.iframe, url = _a.url; | ||
} | ||
export { createDevTools, inspect, inspectMachine }; |
export declare function inspectServer(): void; | ||
//# sourceMappingURL=server.d.ts.map |
@@ -0,0 +0,0 @@ import { Interpreter } from 'xstate'; |
@@ -1,17 +0,9 @@ | ||
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.inspect = exports.inspectMachine = exports.createDevTools = void 0; | ||
var xstate_1 = require("xstate"); | ||
var utils_1 = require("xstate/lib/utils"); | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var _tslib = require('./_virtual/_tslib.js'); | ||
var xstate = require('xstate'); | ||
var utils = require('xstate/lib/utils'); | ||
var serviceMap = new Map(); | ||
@@ -47,4 +39,3 @@ function createDevTools() { | ||
} | ||
exports.createDevTools = createDevTools; | ||
exports.inspectMachine = xstate_1.createMachine({ | ||
var inspectMachine = xstate.createMachine({ | ||
initial: 'pendingConnection', | ||
@@ -91,3 +82,3 @@ context: { | ||
actions: [ | ||
xstate_1.assign({ client: function (_, e) { return e.client; } }), | ||
xstate.assign({ client: function (_, e) { return e.client; } }), | ||
function (ctx) { | ||
@@ -113,6 +104,6 @@ globalThis.__xstate__.services.forEach(function (service) { | ||
createDevTools(); | ||
var _a = __assign(__assign({}, defaultInspectorOptions), options), iframe = _a.iframe, url = _a.url; | ||
var _a = _tslib.__assign(_tslib.__assign({}, defaultInspectorOptions), options), iframe = _a.iframe, url = _a.url; | ||
var resolvedIframe = typeof iframe === 'function' ? iframe() : iframe; | ||
var targetWindow; | ||
var inspectService = xstate_1.interpret(exports.inspectMachine).start(); | ||
var inspectService = xstate.interpret(inspectMachine).start(); | ||
if (resolvedIframe === null) { | ||
@@ -137,3 +128,3 @@ console.warn('No suitable <iframe> found to embed the inspector. Please pass an <iframe> element to `inspect(iframe)` or create an <iframe data-xstate></iframe> element.'); | ||
} | ||
inspectService.send(__assign(__assign({}, event.data), { client: client })); | ||
inspectService.send(_tslib.__assign(_tslib.__assign({}, event.data), { client: client })); | ||
} | ||
@@ -170,3 +161,3 @@ }; | ||
type: 'service.event', | ||
event: JSON.stringify(utils_1.toSCXMLEvent(utils_1.toEventObject(event, payload))), | ||
event: JSON.stringify(utils.toSCXMLEvent(utils.toEventObject(event, payload))), | ||
sessionId: service.sessionId | ||
@@ -203,2 +194,5 @@ }); | ||
} | ||
exports.createDevTools = createDevTools; | ||
exports.inspect = inspect; | ||
exports.inspectMachine = inspectMachine; |
export declare function inspectServer(): void; | ||
//# sourceMappingURL=server.d.ts.map |
{ | ||
"name": "@xstate/inspect", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "XState inspection utilities", | ||
@@ -34,4 +34,3 @@ "keywords": [ | ||
"test": "jest --passWithNoTests", | ||
"build": "tsc && tsc --outDir es --module es2015", | ||
"watch": "tsc -w --module es2015", | ||
"build": "rollup -c", | ||
"prepublish": "npm run build" | ||
@@ -44,5 +43,7 @@ }, | ||
"@types/ws": "^7.2.6", | ||
"rollup": "^1.26.3", | ||
"rollup-plugin-typescript2": "^0.25.2", | ||
"typescript": "^4.0.3", | ||
"ws": "^7.3.1", | ||
"xstate": "*", | ||
"typescript": "^4.0.2" | ||
"xstate": "*" | ||
}, | ||
@@ -49,0 +50,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11
23843
6
1
485