Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

piral-blazor

Package Overview
Dependencies
Maintainers
1
Versions
805
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

piral-blazor - npm Package Compare versions

Comparing version 0.12.0 to 0.12.1-pre.1768

convert.d.ts

21

convert.js

@@ -1,11 +0,12 @@

const { createConverter } = require('./lib/converter');
const { createDependencyLoader } = require('./lib/dependencies');
const convert = createConverter();
const loader = createDependencyLoader(convert);
exports.fromBlazor = (moduleName, dependency, args) => ({
type: 'html',
component: convert(moduleName, dependency, args),
});
"use strict";
exports.__esModule = true;
exports.defineBlazorReferences = exports.fromBlazor = void 0;
var converter_1 = require("./lib/converter");
var dependencies_1 = require("./lib/dependencies");
var convert = converter_1.createConverter();
var loader = dependencies_1.createDependencyLoader(convert);
exports.fromBlazor = function (moduleName, dependency, args) { return ({
type: 'html',
component: convert(moduleName, dependency, args)
}); };
exports.defineBlazorReferences = loader.defineBlazorReferences;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createConverter = void 0;
var tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ var internal_1 = require("./internal");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createBlazorApi = void 0;
var converter_1 = require("./converter");

@@ -4,0 +5,0 @@ var dependencies_1 = require("./dependencies");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createDependencyLoader = void 0;
var internal_1 = require("./internal");

@@ -4,0 +5,0 @@ function createDependencyLoader(convert, lazy) {

@@ -5,2 +5,3 @@ "use strict";

tslib_1.__exportStar(require("./create"), exports);
tslib_1.__exportStar(require("./types"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setPlatform = exports.platform = void 0;
function setPlatform(platformInstance) {

@@ -4,0 +5,0 @@ exports.platform = platformInstance;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initialize = exports.attachEvents = exports.removeReference = exports.addReference = exports.deactivate = exports.activate = exports.eventNames = void 0;
var tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ require("./globals");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BootConfigResult = void 0;
var BootConfigResult = /** @class */ (function () {

@@ -4,0 +5,0 @@ function BootConfigResult(bootConfig, applicationEnvironment) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.attachDebuggerHotkey = exports.hasDebuggingEnabled = void 0;
var currentBrowserIsChrome = window.chrome && navigator.userAgent.indexOf('Edge') < 0; // Edge pretends to be Chrome

@@ -4,0 +5,0 @@ var hasReferencedPdbs = false;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.monoPlatform = void 0;
var tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ var MonoDebugger_1 = require("./MonoDebugger");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAssemblyNameFromUrl = exports.getFileNameFromUrl = void 0;
function getFileNameFromUrl(url) {

@@ -4,0 +5,0 @@ // This could also be called "get last path segment from URL", but the primary

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebAssemblyConfigLoader = void 0;
var tslib_1 = require("tslib");

@@ -37,11 +38,16 @@ var WebAssemblyConfigLoader = /** @class */ (function () {

return [4 /*yield*/, Promise.all((bootConfigResult.bootConfig.config || [])
.filter(function (name) { return name === 'appsettings.json' || name === "appsettings." + bootConfigResult.applicationEnvironment + ".json"; })
.map(function (name) { return tslib_1.__awaiter(_this, void 0, void 0, function () { var _a; return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = { name: name };
return [4 /*yield*/, getConfigBytes(name)];
case 1: return [2 /*return*/, (_a.content = _b.sent(), _a)];
}
}); }); }))];
.filter(function (name) {
return name === 'appsettings.json' || name === "appsettings." + bootConfigResult.applicationEnvironment + ".json";
})
.map(function (name) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var _a;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = { name: name };
return [4 /*yield*/, getConfigBytes(name)];
case 1: return [2 /*return*/, (_a.content = _b.sent(), _a)];
}
});
}); }))];
case 1:

@@ -48,0 +54,0 @@ configFiles = _a.sent();

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebAssemblyResourceLoader = void 0;
var tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ var NavigationManager_1 = require("../Services/NavigationManager");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BrowserRenderer = void 0;
var RenderBatch_1 = require("./RenderBatch/RenderBatch");

@@ -4,0 +5,0 @@ var EventDelegator_1 = require("./EventDelegator");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyCaptureIdToElement = void 0;
function applyCaptureIdToElement(element, referenceCaptureId) {

@@ -4,0 +5,0 @@ element.setAttribute(getCaptureIdAttributeName(referenceCaptureId), '');

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventDelegator = void 0;
var EventForDotNet_1 = require("./EventForDotNet");

@@ -4,0 +5,0 @@ var EventFieldInfo_1 = require("./EventFieldInfo");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventFieldInfo = void 0;
var EventFieldInfo = /** @class */ (function () {

@@ -4,0 +5,0 @@ function EventFieldInfo(componentId, fieldValue) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventForDotNet = void 0;
var tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ var EventForDotNet = /** @class */ (function () {

@@ -29,2 +29,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getClosestDomElement = exports.permuteLogicalChildren = exports.getLogicalChildrenArray = exports.isSvgElement = exports.getLogicalChild = exports.getLogicalSiblingEnd = exports.getLogicalParent = exports.removeLogicalChild = exports.insertLogicalChild = exports.createAndInsertLogicalContainer = exports.toLogicalElement = exports.toLogicalRootCommentElement = void 0;
var logicalChildrenPropname = createSymbolOrFallback('_blazorLogicalChildren');

@@ -31,0 +32,0 @@ var logicalParentPropname = createSymbolOrFallback('_blazorLogicalParent');

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OutOfProcessRenderBatch = void 0;
var Utf8Decoder_1 = require("./Utf8Decoder");

@@ -4,0 +5,0 @@ var updatedComponentsEntryLength = 4; // Each is a single int32 giving the location of the data

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FrameType = exports.EditType = void 0;
var EditType;

@@ -4,0 +5,0 @@ (function (EditType) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SharedMemoryRenderBatch = void 0;
var Environment_1 = require("../../Environment");

@@ -4,0 +5,0 @@ // Used when running on Mono WebAssembly for shared-memory interop. The code here encapsulates

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decodeUtf8 = void 0;
var nativeDecoder = typeof TextDecoder === 'function' ? new TextDecoder('utf-8') : null;

@@ -4,0 +5,0 @@ exports.decodeUtf8 = nativeDecoder

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resetScrollAfterNextBatch = exports.renderBatch = exports.attachRootComponentToElement = exports.attachRootComponentToLogicalElement = void 0;
/* eslint-disable @typescript-eslint/camelcase */

@@ -4,0 +5,0 @@ require("../Platform/Platform");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setEventDispatcher = exports.dispatchEvent = void 0;
var eventDispatcherInstance;

@@ -4,0 +5,0 @@ function dispatchEvent(eventDescriptor, eventArgs) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toAbsoluteUri = exports.navigateTo = exports.attachToEventDelegator = exports.navigationManager = void 0;
var tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ var Renderer_1 = require("../Rendering/Renderer");

{
"name": "piral-blazor",
"version": "0.12.0",
"version": "0.12.1-pre.1768",
"description": "Plugin for integrating Blazor components in Piral.",

@@ -28,2 +28,4 @@ "keywords": [

"src",
"convert.d.ts",
"convert.ts",
"convert.js"

@@ -39,3 +41,3 @@ ],

"scripts": {
"build": "tsc",
"build": "tsc && tsc convert.ts --skipLibCheck --declaration",
"typedoc": "typedoc --json ../../../docs/types/piral-blazor.json src --exclude \"src/**/*.test.*\"",

@@ -51,8 +53,8 @@ "test": "echo \"Error: run tests from root\" && exit 1"

"@types/emscripten": "0.0.34",
"piral-core": "^0.12.0"
"piral-core": "^0.12.1-pre.1768"
},
"peerDependencies": {
"piral-core": "^1.0.0"
"piral-core": "0.12.x || 1.x"
},
"gitHead": "2e08688de476cf93fc4b63d1cbad4a27230cf6fc"
"gitHead": "b3e94d1fc6a541a787506082f6fc9d0b8a89c3f5"
}

@@ -31,3 +31,3 @@ import { ForeignComponent, BaseComponentProps } from 'piral-core';

.then(() => activate(moduleName, props))
.then(refId => {
.then((refId) => {
if (state === 'fresh') {

@@ -40,7 +40,7 @@ id = `${moduleName}-${refId}`;

})
.catch(err => console.error(err));
.catch((err) => console.error(err));
dispose = attachEvents(
el,
ev => data.piral.renderHtmlExtension(ev.detail.target, ev.detail.props),
ev => ctx.router.history.push(ev.detail.to),
(ev) => data.piral.renderHtmlExtension(ev.detail.target, ev.detail.props),
(ev) => ctx.router.history.push(ev.detail.to),
);

@@ -47,0 +47,0 @@ state = 'fresh';

@@ -23,3 +23,3 @@ import type { PiralPlugin } from 'piral-core';

return context => {
return (context) => {
const convert = createConverter(lazy);

@@ -26,0 +26,0 @@ context.converters.blazor = ({ moduleName, args, dependency }) => convert(moduleName, dependency, args);

@@ -14,5 +14,5 @@ import { addReference } from './internal';

Promise.all(
references.map(reference =>
references.map((reference) =>
fetch(reference)
.then(res => res.blob())
.then((res) => res.blob())
.then(addReference),

@@ -19,0 +19,0 @@ ),

@@ -46,3 +46,3 @@ import './globals';

export function addReference(blob: Blob) {
return new Promise(resolve => {
return new Promise((resolve) => {
var reader = new FileReader();

@@ -49,0 +49,0 @@ reader.onload = () => {

@@ -22,3 +22,3 @@ import { WebAssemblyResourceLoader } from '../WebAssemblyResourceLoader';

// Even if debugging isn't enabled, we register the hotkey so we can report why it's not enabled
document.addEventListener('keydown', evt => {
document.addEventListener('keydown', (evt) => {
if (evt.shiftKey && (evt.metaKey || evt.altKey) && evt.code === 'KeyD') {

@@ -25,0 +25,0 @@ if (!hasReferencedPdbs) {

@@ -142,3 +142,3 @@ import { attachDebuggerHotkey, hasDebuggingEnabled } from './MonoDebugger';

const dotnetJsResourceName = Object.keys(resourceLoader.bootConfig.resources.runtime).filter(
n => n.startsWith('dotnet.') && n.endsWith('.js'),
(n) => n.startsWith('dotnet.') && n.endsWith('.js'),
)[0];

@@ -185,5 +185,5 @@ const scriptElem = document.createElement('script');

module.print = line => suppressMessages.indexOf(line) < 0 && console.log(line);
module.print = (line) => suppressMessages.indexOf(line) < 0 && console.log(line);
module.printErr = line => {
module.printErr = (line) => {
console.error(line);

@@ -199,5 +199,8 @@ };

resources.assembly,
filename => `_framework/_bin/${filename}`,
(filename) => `_framework/_bin/${filename}`,
);
const pdbsBeingLoaded = resourceLoader.loadResources(resources.pdb || {}, filename => `_framework/_bin/${filename}`);
const pdbsBeingLoaded = resourceLoader.loadResources(
resources.pdb || {},
(filename) => `_framework/_bin/${filename}`,
);
const wasmBeingLoaded = resourceLoader.loadResource(

@@ -235,4 +238,4 @@ /* name */ dotnetWasmResourceName,

// of the extensions in the URLs. This allows loading assemblies with arbitrary filenames.
assembliesBeingLoaded.forEach(r => addResourceAsAssembly(r, changeExtension(r.name, '.dll')));
pdbsBeingLoaded.forEach(r => addResourceAsAssembly(r, r.name));
assembliesBeingLoaded.forEach((r) => addResourceAsAssembly(r, changeExtension(r.name, '.dll')));
pdbsBeingLoaded.forEach((r) => addResourceAsAssembly(r, r.name));

@@ -250,12 +253,12 @@ // Wire-up callbacks for satellite assemblies. Blazor will call these as part of the application

culturesToLoad
.filter(culture => satelliteResources.hasOwnProperty(culture))
.map(culture =>
resourceLoader.loadResources(satelliteResources[culture], fileName => `_framework/_bin/${fileName}`),
.filter((culture) => satelliteResources.hasOwnProperty(culture))
.map((culture) =>
resourceLoader.loadResources(satelliteResources[culture], (fileName) => `_framework/_bin/${fileName}`),
)
.reduce((previous, next) => previous.concat(next), new Array<LoadingResource>())
.map(async resource => (await resource.response).arrayBuffer()),
.map(async (resource) => (await resource.response).arrayBuffer()),
);
return BINDING.js_to_mono_obj(
resourcePromises.then(resourcesToLoad => {
resourcePromises.then((resourcesToLoad) => {
if (resourcesToLoad.length) {

@@ -305,3 +308,3 @@ window['Blazor']._internal.readSatelliteAssemblies = () => {

// Wait for the data to be loaded and verified
const dataBuffer = await dependency.response.then(r => r.arrayBuffer());
const dataBuffer = await dependency.response.then((r) => r.arrayBuffer());

@@ -409,3 +412,3 @@ // Load it into the Mono runtime

// fall back to ArrayBuffer instantiation
const arrayBuffer = await wasmResource.response.then(r => r.arrayBuffer());
const arrayBuffer = await wasmResource.response.then((r) => r.arrayBuffer());
const arrayBufferResult = await WebAssembly.instantiate(arrayBuffer, imports);

@@ -412,0 +415,0 @@ return arrayBufferResult.instance;

@@ -12,5 +12,6 @@ import { BootConfigResult } from './BootConfig';

.filter(
name => name === 'appsettings.json' || name === `appsettings.${bootConfigResult.applicationEnvironment}.json`,
(name) =>
name === 'appsettings.json' || name === `appsettings.${bootConfigResult.applicationEnvironment}.json`,
)
.map(async name => ({ name, content: await getConfigBytes(name) })),
.map(async (name) => ({ name, content: await getConfigBytes(name) })),
);

@@ -20,3 +21,3 @@

const fileName = BINDING.conv_string(dotNetFileName);
const resolvedFile = configFiles.find(f => f.name === fileName);
const resolvedFile = configFiles.find((f) => f.name === fileName);
return resolvedFile ? BINDING.js_typed_array_to_array(resolvedFile.content) : undefined;

@@ -23,0 +24,0 @@ };

@@ -19,3 +19,3 @@ import { BootJsonData, ResourceList } from './BootConfig';

loadResources(resources: ResourceList, url: (name: string) => string): LoadingResource[] {
return Object.keys(resources).map(name => this.loadResource(name, url(name), resources[name]));
return Object.keys(resources).map((name) => this.loadResource(name, url(name), resources[name]));
}

@@ -80,3 +80,3 @@

const cachedRequests = await cache.keys();
const deletionPromises = cachedRequests.map(async cachedRequest => {
const deletionPromises = cachedRequests.map(async (cachedRequest) => {
if (!(cachedRequest.url in this.usedCacheKeys)) {

@@ -83,0 +83,0 @@ await cache.delete(cachedRequest);

@@ -141,3 +141,3 @@ import { EventForDotNet, UIEventArgs } from './EventForDotNet';

if (evt.type === 'click') {
this.afterClickCallbacks.forEach(callback => callback(evt as MouseEvent));
this.afterClickCallbacks.forEach((callback) => callback(evt as MouseEvent));
}

@@ -277,3 +277,3 @@ }

const result = {};
items.forEach(value => {
items.forEach((value) => {
result[value] = true;

@@ -280,0 +280,0 @@ });

@@ -56,3 +56,3 @@ /*

const children = getLogicalChildrenArray(parentLogicalElement);
Array.from(parent.childNodes).forEach(n => children.push((n as unknown) as LogicalElement));
Array.from(parent.childNodes).forEach((n) => children.push((n as unknown) as LogicalElement));
start[logicalParentPropname] = parentLogicalElement;

@@ -59,0 +59,0 @@ // We might not have an end comment in the case of non-prerendered components.

@@ -38,3 +38,3 @@ import { resetScrollAfterNextBatch } from '../Rendering/Renderer';

// So instead of registering our own native event, register using the EventDelegator.
eventDelegator.notifyAfterClick(event => {
eventDelegator.notifyAfterClick((event) => {
if (!hasEnabledNavigationInterception) {

@@ -41,0 +41,0 @@ return;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc