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

@appsemble/preact

Package Overview
Dependencies
Maintainers
4
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appsemble/preact - npm Package Compare versions

Comparing version 0.13.7 to 0.13.8

13

dist/index.d.ts

@@ -15,2 +15,7 @@ import { BootstrapParams } from '@appsemble/sdk';

* Mount a Preact component returned by a bootstrap function in the shadow DOM of a block.
*
* @param Component - The Preact component to mount.
* @param messages - Translatable messages to serve (deprecated).
*
* @returns A promise which gets resolved if the component calls `ready()`.
*/

@@ -25,4 +30,10 @@ export declare function mount(Component: ComponentType<BlockProps>, messages?: {

* A HOC which passes the Appsemble block values to he wrapped Preact component.
*
* @deprecated Use `useBlock()` instead.
*
* @param Component - The Preact componen to wrap.
*
* @returns The wrapper component.
*/
export declare function withBlock<P extends object>(Component: ComponentType<Omit<BlockProps, keyof P> & P>): ComponentType<P>;
export declare function withBlock<P extends {}>(Component: ComponentType<Omit<BlockProps, keyof P> & P>): ComponentType<P>;
export declare function useBlock(): BlockProps;

@@ -29,0 +40,0 @@ export interface FormattedMessageProps {

@@ -8,2 +8,7 @@ import { bootstrap as sdkBootstrap } from '@appsemble/sdk';

* Mount a Preact component returned by a bootstrap function in the shadow DOM of a block.
*
* @param Component - The Preact component to mount.
* @param messages - Translatable messages to serve (deprecated).
*
* @returns A promise which gets resolved if the component calls `ready()`.
*/

@@ -33,2 +38,8 @@ export function mount(Component, messages) {

* A HOC which passes the Appsemble block values to he wrapped Preact component.
*
* @deprecated Use `useBlock()` instead.
*
* @param Component - The Preact componen to wrap.
*
* @returns The wrapper component.
*/

@@ -43,3 +54,3 @@ export function withBlock(Component) {

const { messages } = useBlock();
if (!Object.prototype.hasOwnProperty.call(messages, id)) {
if (!Object.hasOwnProperty.call(messages, id)) {
return h(Fragment, null,

@@ -46,0 +57,0 @@ "Untranslated message ID: ",

6

package.json
{
"name": "@appsemble/preact",
"version": "0.13.7",
"version": "0.13.8",
"description": "Build your own blocks using Preact",

@@ -17,3 +17,3 @@ "keywords": [

],
"homepage": "https://appsemble.dev",
"homepage": "https://appsemble.app",
"bugs": "https://gitlab.com/appsemble/appsemble/issues",

@@ -41,5 +41,5 @@ "repository": {

"peerDependencies": {
"@appsemble/sdk": "0.13.7",
"@appsemble/sdk": "0.13.8",
"preact": "^10.0.4"
}
}

@@ -15,5 +15,5 @@ # Appsemble Preact SDK

import { bootstrap } from '@appsemble/preact';
import React from 'react';
import { h, VNode } from 'preact';
function MyBlock({ actions }) {
function MyBlock({ actions }): VNode {
return (

@@ -20,0 +20,0 @@ <button onClick={actions.onClick.dispatch} type="button">

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