Comparing version
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./jsx-runtime.js");const u=(r,s,t,n,j)=>e.jsx(r,{...s,__source:j},t);exports.Fragment=e.Fragment,exports.jsxDEV=u; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./jsx-runtime-40806bf7.js");const j=(s,r,t,i,u)=>e.j(s,{...r,__source:u},t);exports.Fragment=e.F,exports.jsxDEV=j; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const{defineProperty:r,create:f,keys:j,freeze:u}=Object,s="$$jsxslack",d=s+"Component",m=(e,l=null,...t)=>{let n=f(null);if(typeof e=="function"){let o={...l||{}},{length:c}=t;c===1?[o.children]=t:c>1&&(o.children=t),n=e(o)}if(n&&typeof n=="object"){for(let o of j(n))n[o]===void 0&&delete n[o];if(!n[s]){let o=t;if(!t.length){let{children:c}=l||{};c!==void 0&&(o=[].concat(c))}r(n,s,{value:{type:e,props:l,children:o}})}}return n},b=(e,l,t={})=>r(l,d,{value:u(r({...t},"name",{value:e,enumerable:!0}))}),a=b("Fragment",({children:e})=>[].concat(e)),i=(e,l,t)=>m(e!=null?e:a,{...l,...t!==void 0?{key:t}:{}}),v=i,x=a;exports.Fragment=x,exports.jsx=i,exports.jsxs=v; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./jsx-runtime-40806bf7.js");exports.Fragment=e.F,exports.jsx=e.j,exports.jsxs=e.a; |
{ | ||
"name": "jsx-slack", | ||
"version": "4.6.1", | ||
"version": "5.0.0", | ||
"description": "Build JSON object for Slack Block Kit surfaces from JSX", | ||
@@ -27,3 +27,3 @@ "author": { | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=14" | ||
}, | ||
@@ -84,27 +84,27 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.17.8", | ||
"@babel/preset-env": "^7.16.11", | ||
"@babel/preset-react": "^7.16.7", | ||
"@babel/preset-typescript": "^7.16.7", | ||
"@babel/core": "^7.18.5", | ||
"@babel/preset-env": "^7.18.2", | ||
"@babel/preset-react": "^7.17.12", | ||
"@babel/preset-typescript": "^7.17.12", | ||
"@rollup/plugin-alias": "^3.1.9", | ||
"@rollup/plugin-commonjs": "21.0.3", | ||
"@rollup/plugin-commonjs": "22.0.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^13.1.3", | ||
"@types/jest": "^27.4.1", | ||
"@typescript-eslint/eslint-plugin": "^5.16.0", | ||
"@typescript-eslint/parser": "^5.16.0", | ||
"@rollup/plugin-node-resolve": "^13.3.0", | ||
"@types/jest": "^28.1.2", | ||
"@typescript-eslint/eslint-plugin": "^5.28.0", | ||
"@typescript-eslint/parser": "^5.28.0", | ||
"babel-plugin-transform-rename-import": "^2.3.0", | ||
"codemirror": "^5.65.2", | ||
"cssnano": "^5.1.5", | ||
"esbuild": "^0.14.28", | ||
"eslint": "^8.12.0", | ||
"codemirror": "^5.65.5", | ||
"cssnano": "^5.1.12", | ||
"esbuild": "^0.14.46", | ||
"eslint": "^8.18.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-jest": "^26.1.3", | ||
"eslint-plugin-react": "^7.29.4", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jest": "^26.5.3", | ||
"eslint-plugin-react": "^7.30.0", | ||
"hast-util-to-mdast": "8.3.1", | ||
"he": "^1.2.0", | ||
"htm": "^3.1.0", | ||
"jest": "^27.5.1", | ||
"jest-junit": "^13.0.0", | ||
"htm": "^3.1.1", | ||
"jest": "^28.1.1", | ||
"jest-junit": "^13.2.0", | ||
"lodash.debounce": "^4.0.8", | ||
@@ -114,16 +114,16 @@ "mdast-util-phrasing": "^3.0.0", | ||
"pako": "^2.0.4", | ||
"postcss": "^8.4.12", | ||
"postcss": "^8.4.14", | ||
"postcss-import": "^14.1.0", | ||
"prettier": "^2.6.1", | ||
"puppeteer": "^13.5.1", | ||
"prettier": "^2.7.1", | ||
"puppeteer": "^14.4.1", | ||
"rimraf": "^3.0.1", | ||
"rollup": "^2.70.1", | ||
"rollup": "^2.75.6", | ||
"rollup-plugin-copy": "^3.4.0", | ||
"rollup-plugin-esbuild": "^4.8.2", | ||
"rollup-plugin-esbuild": "^4.9.1", | ||
"rollup-plugin-livereload": "^2.0.5", | ||
"rollup-plugin-postcss": "^4.0.2", | ||
"rollup-plugin-serve": "^1.1.0", | ||
"ts-jest": "^27.1.4", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.6.3", | ||
"ts-jest": "^28.0.5", | ||
"tslib": "^2.4.0", | ||
"typescript": "^4.7.4", | ||
"unist-util-parents": "^2.0.0", | ||
@@ -133,4 +133,4 @@ "unist-util-visit": "^4.1.0" | ||
"dependencies": { | ||
"@slack/types": "^2.4.0" | ||
"@slack/types": "^2.5.0" | ||
} | ||
} |
@@ -60,3 +60,3 @@ <h1 align="center"> | ||
We require Node.js >= 12. If you are using TypeScript, we also require TS >= 3.7. | ||
We require Node.js >= 14. If you are using TypeScript, we also require TS >= 3.7. | ||
@@ -63,0 +63,0 @@ ```bash |
@@ -147,3 +147,3 @@ /** @jsx createElementInternal */ | ||
export declare const knownInputs: string[]; | ||
export declare const wrapInInput: <T extends object>(obj: T, props: Omit<Partial<InputLayoutProps>, 'children'>, generatedFrom?: BuiltInComponent<any> | undefined) => InputBlock | T; | ||
export declare const wrapInInput: <T extends object>(obj: T, props: Omit<Partial<InputLayoutProps>, 'children'>, generatedFrom?: BuiltInComponent<any>) => InputBlock | T; | ||
/** | ||
@@ -150,0 +150,0 @@ * `<Input>` has various usages: Input component for single text element, |
import { JSXSlack } from '../jsx'; | ||
export declare const assignMetaFrom: <T extends object>(element: JSXSlack.Node, obj: T) => T & JSXSlack.Node<any>; | ||
export declare const assignMetaFrom: <T extends object>(element: JSXSlack.Node, obj: T) => T & JSXSlack.Node<{}>; | ||
export declare const alias: (element: JSXSlack.Node, to: JSXSlack.FC<any>, preserveOriginMeta?: boolean) => JSXSlack.Node | null; | ||
export declare const resolveTagName: (element: unknown) => string | undefined; |
@@ -9,3 +9,6 @@ import { JSXSlack } from './jsx'; | ||
export declare type FC<P extends {} = {}> = JSXSlack.FC<P>; | ||
export declare type VoidFunctionComponent<P extends {} = Record<any, never>> = JSXSlack.VoidFunctionComponent<P>; | ||
export declare type VFC<P extends {} = Record<any, never>> = JSXSlack.VFC<P>; | ||
export declare type PropsWithChildren<P extends {} = {}> = JSXSlack.PropsWithChildren<P>; | ||
/** @deprecated Use FunctionComponent instead. */ | ||
export declare type VoidFunctionComponent<P extends {} = {}> = JSXSlack.VoidFunctionComponent<P>; | ||
/** @deprecated Use FunctionComponent instead. */ | ||
export declare type VFC<P extends {} = {}> = JSXSlack.VFC<P>; |
@@ -7,3 +7,3 @@ import type { JSXSlack } from './jsx'; | ||
} | ||
export declare const createElementInternal: (type: JSXSlack.FC | keyof JSXSlack.JSX.IntrinsicElements, props?: JSXSlack.Props | null, ...children: JSXSlack.ChildElement[]) => JSXSlack.JSX.Element | null; | ||
export declare const createElementInternal: <P extends {} = {}>(type: JSXSlack.FC<P> | keyof JSXSlack.JSX.IntrinsicElements, props?: P | null, ...children: JSXSlack.ChildElement[]) => JSXSlack.JSX.Element | null; | ||
/** | ||
@@ -27,3 +27,3 @@ * Create the component for JSON payload building with jsx-slack. | ||
*/ | ||
export declare const createComponent: <P extends {}, O extends object>(name: string, component: (props: JSXSlack.Props<P>) => O | null, meta?: Record<any, any>) => BuiltInComponent<P>; | ||
export declare const createComponent: <P extends {}, O extends object>(name: string, component: (props: P) => O | null, meta?: Record<any, any>) => BuiltInComponent<P>; | ||
export declare const FragmentInternal: BuiltInComponent<{ | ||
@@ -36,4 +36,4 @@ children: JSXSlack.ChildElements; | ||
* @param fn - A function to verify | ||
* @return `true` if the passed object was a jsx-slack component., otherwise | ||
* `false` | ||
* @return `true` if the passed object was a jsx-slack component, otherwise | ||
* `false`. | ||
*/ | ||
@@ -51,3 +51,3 @@ export declare const isValidComponent: <T = any>(fn: unknown) => fn is BuiltInComponent<T>; | ||
*/ | ||
export declare const isValidElementFromComponent: (obj: unknown, component?: JSXSlack.FunctionalComponent<any> | undefined) => obj is JSXSlack.JSX.Element; | ||
export declare const isValidElementFromComponent: (obj: unknown, component?: JSXSlack.FunctionComponent<any>) => obj is JSXSlack.JSX.Element; | ||
/** | ||
@@ -54,0 +54,0 @@ * Clean up hidden meta value for jsx-slack from object. |
@@ -37,12 +37,18 @@ import { OptgroupProps } from './block-kit/composition/Optgroup'; | ||
type MapCallbackFn<T> = (this: FilteredChild | null, child: FilteredChild | null, index: number) => T; | ||
export type Props<P = any> = { | ||
export type PropsWithChildren<P extends {} = {}> = { | ||
children?: ChildElements; | ||
} & P; | ||
export type FunctionalComponent<P extends {} = {}> = (props: Props<P>) => Node | null; | ||
export type FunctionComponent<P extends {} = {}> = FunctionalComponent<P>; | ||
export type FC<P extends {} = {}> = FunctionalComponent<P>; | ||
export type VoidFunctionalComponent<P extends {} = Record<any, never>> = (props: P) => Node | null; | ||
export type VoidFunctionComponent<P extends {} = Record<any, never>> = VoidFunctionalComponent<P>; | ||
export type VFC<P extends {} = Record<any, never>> = VoidFunctionalComponent<P>; | ||
export interface Node<P extends {} = any> { | ||
export type FunctionComponent<P extends {} = {}> = (props: P) => Node<P> | null; | ||
export type FC<P extends {} = {}> = FunctionComponent<P>; | ||
/** @deprecated Use an original type instead. */ | ||
export type Props<P extends {} = {}> = P; | ||
/** @deprecated Use FunctionComponent instead. */ | ||
export type FunctionalComponent<P extends {} = {}> = FunctionComponent<P>; | ||
/** @deprecated Use FunctionComponent instead. */ | ||
export type VoidFunctionComponent<P extends {} = {}> = FunctionComponent<P>; | ||
/** @deprecated Use FunctionComponent instead. */ | ||
export type VFC<P extends {} = {}> = FunctionComponent<P>; | ||
/** @deprecated Use FunctionComponent instead. */ | ||
export type VoidFunctionalComponent<P extends {} = {}> = FunctionComponent<P>; | ||
export interface Node<P extends {} = {}> { | ||
/** | ||
@@ -54,3 +60,3 @@ * @internal | ||
type: FC<P> | string; | ||
props: Props<P>; | ||
props: P; | ||
children: ChildElement[]; | ||
@@ -80,5 +86,5 @@ }; | ||
*/ | ||
export const createElement: (type: FC<{}> | keyof JSX.IntrinsicElements, props?: any, ...children: ChildElement[]) => JSX.Element | null; | ||
export const createElement: <P extends {} = {}>(type: FC<P> | keyof JSX.IntrinsicElements, props?: P | null, ...children: ChildElement[]) => JSX.Element | null; | ||
/** An alias into `JSXSlack.createElement`. */ | ||
export const h: (type: FC<{}> | keyof JSX.IntrinsicElements, props?: any, ...children: ChildElement[]) => JSX.Element | null; | ||
export const h: <P extends {} = {}>(type: FC<P> | keyof JSX.IntrinsicElements, props?: P | null, ...children: ChildElement[]) => JSX.Element | null; | ||
/** | ||
@@ -185,5 +191,5 @@ * Group a list of JSX elements. | ||
*/ | ||
export const exactMode: (mode?: boolean | undefined) => boolean; | ||
export const exactMode: (mode?: boolean) => boolean; | ||
export namespace JSX { | ||
export interface Element extends Node { | ||
export interface Element extends Node<any> { | ||
} | ||
@@ -190,0 +196,0 @@ export interface IntrinsicElements { |
Sorry, the diff of this file is too big to display
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
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
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
447673
0.2%137
3.01%4068
0.3%Updated